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; {