diff options
author | George Rimar <grimar@accesssoftek.com> | 2019-03-18 14:27:41 +0000 |
---|---|---|
committer | George Rimar <grimar@accesssoftek.com> | 2019-03-18 14:27:41 +0000 |
commit | faf308b11a9f6702575593cf036626358851f318 (patch) | |
tree | 4ae042ee1d58e1239ebc004d55679cfa77250622 /llvm/test/tools/llvm-objcopy/ELF/shstrtab-optimize.test | |
parent | 58e9ef139ddfe1b3a6d90deae1c432677a25ec56 (diff) | |
download | bcm5719-llvm-faf308b11a9f6702575593cf036626358851f318.tar.gz bcm5719-llvm-faf308b11a9f6702575593cf036626358851f318.zip |
[llvm-objcopy] - Calculate the string table section sizes correctly.
This fixes the https://bugs.llvm.org/show_bug.cgi?id=40980.
Previously if string optimization occurred as a result of
StringTableBuilder's finalize() method, the size wasn't updated.
This hopefully also makes the interaction between sections during finalization
processes a bit more clear.
Differential revision: https://reviews.llvm.org/D59488
llvm-svn: 356371
Diffstat (limited to 'llvm/test/tools/llvm-objcopy/ELF/shstrtab-optimize.test')
-rw-r--r-- | llvm/test/tools/llvm-objcopy/ELF/shstrtab-optimize.test | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/llvm/test/tools/llvm-objcopy/ELF/shstrtab-optimize.test b/llvm/test/tools/llvm-objcopy/ELF/shstrtab-optimize.test new file mode 100644 index 00000000000..24b546cbaf5 --- /dev/null +++ b/llvm/test/tools/llvm-objcopy/ELF/shstrtab-optimize.test @@ -0,0 +1,28 @@ +# RUN: yaml2obj %s > %t +# RUN: llvm-objcopy %t %t2 +# RUN: llvm-readobj --sections %t2 | FileCheck %s + +## Check we have the correct size of the .shstrtab section +## after the strings tail merge optimization. + +# CHECK: Name: .shstrtab +# CHECK-NEXT: Type: SHT_STRTAB +# CHECK-NEXT: Flags [ +# CHECK-NEXT: ] +# CHECK-NEXT: Address: +# CHECK-NEXT: Offset: +# CHECK-NEXT: Size: 36 + +!ELF +FileHeader: + Class: ELFCLASS64 + Data: ELFDATA2LSB + Type: ET_REL + Machine: EM_X86_64 +Sections: + - Name: .bar + Type: SHT_PROGBITS + Flags: [ ] + - Name: .foo.bar + Type: SHT_PROGBITS + Flags: [ ] |