From: Simon Atanasyan Date: Thu, 9 Jul 2015 18:23:02 +0000 (+0000) Subject: [yaml2obj] Initialize sh_addralign field for the .symtab section X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=ba8d948e93af3096c9bdd2ead2886d6b1e58279b;p=oota-llvm.git [yaml2obj] Initialize sh_addralign field for the .symtab section git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@241835 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/test/Object/yaml2obj-elf-section-basic.yaml b/test/Object/yaml2obj-elf-section-basic.yaml index 1d927433b7c..69d3ae91b71 100644 --- a/test/Object/yaml2obj-elf-section-basic.yaml +++ b/test/Object/yaml2obj-elf-section-basic.yaml @@ -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: } diff --git a/tools/yaml2obj/yaml2elf.cpp b/tools/yaml2obj/yaml2elf.cpp index 4940e837367..a247f48c053 100644 --- a/tools/yaml2obj/yaml2elf.cpp +++ b/tools/yaml2obj/yaml2elf.cpp @@ -267,6 +267,7 @@ void ELFState::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 Syms; {