Skip to content

Commit

Permalink
[yaml2obj][ELF] Assign name (.shstrtab) to the section holds sections…
Browse files Browse the repository at this point in the history
… names.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@203897 91177308-0d34-0410-b5e6-96231b3b80d8
  • Loading branch information
atanasyan committed Mar 14, 2014
1 parent dfbd262 commit 9f685d3
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
13 changes: 13 additions & 0 deletions test/Object/yaml2obj-elf-section-basic.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,3 +33,16 @@ Sections:
# CHECK: SectionData (
# CHECK-NEXT: 0000: EBFE
# CHECK-NEXT: )
#
# CHECK: Section {
# CHECK: Name: .symtab (7)
# CHECK: Type: SHT_SYMTAB (0x2)
# CHECK: }
# CHECK: Section {
# CHECK: Name: .strtab (15)
# CHECK: Type: SHT_STRTAB (0x3)
# CHECK: }
# CHECK: Section {
# CHECK: Name: .shstrtab (23)
# CHECK: Type: SHT_STRTAB (0x3)
# CHECK: }
1 change: 1 addition & 0 deletions tools/yaml2obj/yaml2elf.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -357,6 +357,7 @@ static int writeELF(raw_ostream &OS, const ELFYAML::Object &Doc) {
// Section header string table header.
Elf_Shdr SHStrTabSHeader;
zero(SHStrTabSHeader);
SHStrTabSHeader.sh_name = SHStrTab.addString(StringRef(".shstrtab"));
createStringTableSectionHeader(SHStrTabSHeader, SHStrTab, CBA);
SHeaders.push_back(SHStrTabSHeader);

Expand Down

0 comments on commit 9f685d3

Please sign in to comment.