Skip to content

Commit

Permalink
[yaml2obj] Initialize sh_addralign field for the .symtab section
Browse files Browse the repository at this point in the history
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@241835 91177308-0d34-0410-b5e6-96231b3b80d8
  • Loading branch information
atanasyan committed Jul 9, 2015
1 parent 085d10b commit ba8d948
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
3 changes: 3 additions & 0 deletions test/Object/yaml2obj-elf-section-basic.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -65,12 +65,15 @@ Sections:
# CHECK: Section {
# CHECK: Name: .symtab (25)
# CHECK: Type: SHT_SYMTAB (0x2)
# CHECK: AddressAlignment: 8
# CHECK: }
# CHECK: Section {
# CHECK: Name: .strtab (17)
# CHECK: Type: SHT_STRTAB (0x3)
# CHECK: AddressAlignment: 1
# CHECK: }
# CHECK: Section {
# CHECK: Name: .shstrtab (7)
# CHECK: Type: SHT_STRTAB (0x3)
# CHECK: AddressAlignment: 1
# CHECK: }
1 change: 1 addition & 0 deletions tools/yaml2obj/yaml2elf.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -267,6 +267,7 @@ void ELFState<ELFT>::initSymtabSectionHeader(Elf_Shdr &SHeader,
// One greater than symbol table index of the last local symbol.
SHeader.sh_info = Doc.Symbols.Local.size() + 1;
SHeader.sh_entsize = sizeof(Elf_Sym);
SHeader.sh_addralign = 8;

std::vector<Elf_Sym> Syms;
{
Expand Down

0 comments on commit ba8d948

Please sign in to comment.