diff options
| author | Georgii Rymar <grimar@accesssoftek.com> | 2019-11-27 13:45:04 +0300 |
|---|---|---|
| committer | Georgii Rymar <grimar@accesssoftek.com> | 2019-11-28 12:41:29 +0300 |
| commit | 7f362f04a7812111dec7eb11279a53566e09cdfb (patch) | |
| tree | 8f1e15811cd37a17fe9b478c5d6603af1daf715f /llvm/test/tools/llvm-readobj/elf-verdef-invalid.test | |
| parent | f5c54f40327b1680bf7e55d358b43a92395ae669 (diff) | |
| download | bcm5719-llvm-7f362f04a7812111dec7eb11279a53566e09cdfb.tar.gz bcm5719-llvm-7f362f04a7812111dec7eb11279a53566e09cdfb.zip | |
[llvm-readelf] - Make GNU style dumping of invalid SHT_GNU_verdef be consistent with LLVM style.
When we dump SHT_GNU_verdef section that has sh_link that references a non-existent section,
llvm-readobj reports a warning and continues dump, but llvm-readelf fails with a error.
This patch fixes the issue and opens road for futher follow-ups for
improving the printGNUVersionSectionProlog().
Differential revision: https://reviews.llvm.org/D70776
Diffstat (limited to 'llvm/test/tools/llvm-readobj/elf-verdef-invalid.test')
| -rw-r--r-- | llvm/test/tools/llvm-readobj/elf-verdef-invalid.test | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/llvm/test/tools/llvm-readobj/elf-verdef-invalid.test b/llvm/test/tools/llvm-readobj/elf-verdef-invalid.test index 493537464a0..3a4de369838 100644 --- a/llvm/test/tools/llvm-readobj/elf-verdef-invalid.test +++ b/llvm/test/tools/llvm-readobj/elf-verdef-invalid.test @@ -3,14 +3,14 @@ ## Check that we report a warning when sh_link references a non-existent section. # RUN: yaml2obj %s --docnum=1 -o %t1 -# RUN: llvm-readobj -V %t1 2>&1 | FileCheck %s --check-prefix=INVALID-LINK-LLVM -DFILE=%t1 -# RUN: not llvm-readelf -V %t1 2>&1 | FileCheck %s --check-prefix=INVALID-LINK-GNU -DFILE=%t1 +# RUN: llvm-readobj -V %t1 2>&1 | FileCheck %s --check-prefix=INVALID-LINK-LLVM --implicit-check-not="warning:" -DFILE=%t1 +# RUN: llvm-readelf -V %t1 2>&1 | FileCheck %s --check-prefix=INVALID-LINK-GNU --implicit-check-not="warning:" -DFILE=%t1 # INVALID-LINK-LLVM: warning: '[[FILE]]': invalid section linked to SHT_GNU_verdef section with index 1: invalid section index: 255 -## TODO: llvm-readelf should also report a meaningful warning instead of an error. -# INVALID-LINK-GNU: Version definition -# INVALID-LINK-GNU: error: '[[FILE]]': invalid section index: 255 +# INVALID-LINK-GNU: Version definition section '.gnu.version_d' contains 0 entries: +# INVALID-LINK-GNU: warning: '[[FILE]]': invalid section linked to SHT_GNU_verdef section with index 1: invalid section index: 255 +# INVALID-LINK-GNU-NEXT: Addr: 0000000000000000 Offset: 0x000040 Link: 255 (<corrupt>) --- !ELF FileHeader: |

