summaryrefslogtreecommitdiffstats
path: root/llvm/test/Object
diff options
context:
space:
mode:
authorGeorgii Rymar <grimar@accesssoftek.com>2019-12-03 12:54:36 +0300
committerGeorgii Rymar <grimar@accesssoftek.com>2019-12-06 15:35:05 +0300
commit18cf93a6eddfd201df87f9152bee38e81dfdc40f (patch)
treef9c46ab0305f5fbaf7738b3e2435cc9dc657e7a2 /llvm/test/Object
parent39ccc099c901ca511f0c43f163adef6699038326 (diff)
downloadbcm5719-llvm-18cf93a6eddfd201df87f9152bee38e81dfdc40f.tar.gz
bcm5719-llvm-18cf93a6eddfd201df87f9152bee38e81dfdc40f.zip
[llvm-readobj][llvm-readelf] - Refactor parsing of the SHT_GNU_versym section.
This introduce a new helper which is used to parse the SHT_GNU_versym section. LLVM/GNU styles implementations now use it to share the logic. Differential revision: https://reviews.llvm.org/D71054
Diffstat (limited to 'llvm/test/Object')
-rw-r--r--llvm/test/Object/invalid.test7
-rw-r--r--llvm/test/Object/multiple-sections.yaml8
2 files changed, 10 insertions, 5 deletions
diff --git a/llvm/test/Object/invalid.test b/llvm/test/Object/invalid.test
index 37563652bd6..91a93b06b96 100644
--- a/llvm/test/Object/invalid.test
+++ b/llvm/test/Object/invalid.test
@@ -637,13 +637,13 @@ Sections:
Symbols:
- Name: foo
-## Check that we report an error if SHT_GNU_versym has invalid
+## Check that we report a warning if SHT_GNU_versym has invalid
## sh_entsize value (3 instead of 2) when trying to access the entries.
# RUN: yaml2obj %s --docnum=30 -o %t30
-# RUN: not llvm-readobj -V %t30 2>&1 | FileCheck -DFILE=%t30 --check-prefix=INVALID-VER-SHENTSIZE %s
+# RUN: llvm-readobj -V %t30 2>&1 | FileCheck -DFILE=%t30 --check-prefix=INVALID-VER-SHENTSIZE %s
-# INVALID-VER-SHENTSIZE: error: '[[FILE]]': section [index 1] has invalid sh_entsize: expected 2, but got 3
+# INVALID-VER-SHENTSIZE: warning: '[[FILE]]': cannot read content of SHT_GNU_versym section with index 1: section [index 1] has an invalid sh_entsize: 3
--- !ELF
FileHeader:
@@ -657,6 +657,7 @@ Sections:
Type: SHT_GNU_versym
EntSize: 0x0000000000000003
Entries: [ ]
+ Link: .dynsym
## Needed to trigger creation of .dynsym.
DynamicSymbols:
- Name: foo
diff --git a/llvm/test/Object/multiple-sections.yaml b/llvm/test/Object/multiple-sections.yaml
index 197725595be..55b0ce84409 100644
--- a/llvm/test/Object/multiple-sections.yaml
+++ b/llvm/test/Object/multiple-sections.yaml
@@ -4,6 +4,7 @@
# Test that multiple sections with the same type does not trigger an error.
# CHECK: ElfHeader {
+# CHECK: VersionSymbols [
# CHECK: VersionDefinitions [
# CHECK: VersionRequirements [
# CHECK: CGProfile [
@@ -23,10 +24,12 @@ Sections:
EntSize: 24
- Name: .versym
Type: SHT_GNU_versym
- Entries: [ ]
+ Entries: [ 0 ]
+ Link: .dynsym
- Name: .versym2
Type: SHT_GNU_versym
- Entries: [ ]
+ Entries: [ 0 ]
+ Link: .dynsym
- Name: .verdef
Type: SHT_GNU_verdef
Info: 0x0000000000000000
@@ -59,4 +62,5 @@ Sections:
Content: ''
Symbols:
- Name: f
+DynamicSymbols: []
...
OpenPOWER on IntegriCloud