summaryrefslogtreecommitdiffstats
path: root/llvm/test/tools
diff options
context:
space:
mode:
authorGeorge Rimar <grimar@accesssoftek.com>2019-08-05 13:54:35 +0000
committerGeorge Rimar <grimar@accesssoftek.com>2019-08-05 13:54:35 +0000
commit149aa2f7fc6214e7f340da9011a857d75fe5a652 (patch)
tree7e3dcaaa6d7966116270717db5de95a699a67c07 /llvm/test/tools
parent2a4817637350661b9002c10ff830241697e0f639 (diff)
downloadbcm5719-llvm-149aa2f7fc6214e7f340da9011a857d75fe5a652.tar.gz
bcm5719-llvm-149aa2f7fc6214e7f340da9011a857d75fe5a652.zip
[yaml2obj] - Allow overriding sh_entsize for SHT_GNU_versym sections.
This allows to write a test case for one of untested errors in llvm/Object/ELF.h. I did it in this patch to demonstrate. Differential revision: https://reviews.llvm.org/D65394 llvm-svn: 367860
Diffstat (limited to 'llvm/test/tools')
-rw-r--r--llvm/test/tools/yaml2obj/versym-section.yaml28
1 files changed, 25 insertions, 3 deletions
diff --git a/llvm/test/tools/yaml2obj/versym-section.yaml b/llvm/test/tools/yaml2obj/versym-section.yaml
index fa28ae569b6..6e0cecba19e 100644
--- a/llvm/test/tools/yaml2obj/versym-section.yaml
+++ b/llvm/test/tools/yaml2obj/versym-section.yaml
@@ -1,9 +1,9 @@
-# RUN: yaml2obj %s -o %t
-# RUN: llvm-readobj -V %t | FileCheck %s
-
## Check we are able to produce a valid SHT_GNU_versym
## section from its description.
+# RUN: yaml2obj --docnum=1 %s -o %t1
+# RUN: llvm-readobj -V %t1 | FileCheck %s
+
# CHECK: Version symbols {
# CHECK-NEXT: Section Name: .gnu.version
# CHECK-NEXT: Address: 0x200210
@@ -89,3 +89,25 @@ DynamicSymbols:
- Name: f2
Binding: STB_GLOBAL
...
+
+## Check we are able to set custom sh_entsize field for SHT_GNU_versym section.
+
+# RUN: yaml2obj --docnum=2 %s -o %t2
+# RUN: llvm-readelf -S %t2 | FileCheck %s --check-prefix=ENTSIZE
+
+# ENTSIZE: Section Headers:
+# ENTSIZE: [Nr] Name Type Address Off Size ES
+# ENTSIZE: [ 1] .gnu.version VERSYM 0000000000000000 000180 000000 03
+
+--- !ELF
+FileHeader:
+ Class: ELFCLASS64
+ Data: ELFDATA2LSB
+ OSABI: ELFOSABI_FREEBSD
+ Type: ET_DYN
+ Machine: EM_X86_64
+Sections:
+ - Name: .gnu.version
+ Type: SHT_GNU_versym
+ EntSize: 0x0000000000000003
+ Entries: [ ]
OpenPOWER on IntegriCloud