[yaml2obj] Initialize sh_addralign field for the .symtab section
authorSimon Atanasyan <simon@atanasyan.com>
Thu, 9 Jul 2015 18:23:02 +0000 (18:23 +0000)
committerSimon Atanasyan <simon@atanasyan.com>
Thu, 9 Jul 2015 18:23:02 +0000 (18:23 +0000)
llvm-svn: 241835

llvm/test/Object/yaml2obj-elf-section-basic.yaml
llvm/tools/yaml2obj/yaml2elf.cpp

index 1d92743..69d3ae9 100644 (file)
@@ -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:        }
index 4940e83..a247f48 100644 (file)
@@ -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;
   {