summaryrefslogtreecommitdiffstats
path: root/llvm/test/Object
diff options
context:
space:
mode:
authorGeorge Rimar <grimar@accesssoftek.com>2019-08-08 09:49:05 +0000
committerGeorge Rimar <grimar@accesssoftek.com>2019-08-08 09:49:05 +0000
commitd3963051c49037b1ce6edace90f59056d3bddffa (patch)
treed9ac3df45a3acaffb0611b8ce714efe2d7d7eaba /llvm/test/Object
parent6db975b7b89df9d4b27fa40411963f8f8891c349 (diff)
downloadbcm5719-llvm-d3963051c49037b1ce6edace90f59056d3bddffa.tar.gz
bcm5719-llvm-d3963051c49037b1ce6edace90f59056d3bddffa.zip
[yaml2obj/obj2yaml] - Add a basic support for extended section indexes.
In some cases a symbol might have section index == SHN_XINDEX. This is an escape value indicating that the actual section header index is too large to fit in the containing field. Then the SHT_SYMTAB_SHNDX section is used. It contains the 32bit values that stores section indexes. ELF gABI says that there can be multiple SHT_SYMTAB_SHNDX sections, i.e. for example one for .symtab and one for .dynsym (1) https://groups.google.com/forum/#!topic/generic-abi/-XJAV5d8PRg (2) DT_SYMTAB_SHNDX: http://www.sco.com/developers/gabi/latest/ch5.dynamic.html In this patch I am only supporting a single SHT_SYMTAB_SHNDX associated with a .symtab. This is a more or less common case which is used a few tests I saw in LLVM. I decided not to create the SHT_SYMTAB_SHNDX section as "implicit", but implement is like a kind of regular section for now. i.e. tools do not recreate this section or its content, like they do for symbol table sections, for example. That should allow to write all kind of possible broken test cases for our needs and keep the output closer to requested. Differential revision: https://reviews.llvm.org/D65446 llvm-svn: 368272
Diffstat (limited to 'llvm/test/Object')
-rw-r--r--llvm/test/Object/invalid.test5
1 files changed, 2 insertions, 3 deletions
diff --git a/llvm/test/Object/invalid.test b/llvm/test/Object/invalid.test
index 05f38e9d007..7566ab23d17 100644
--- a/llvm/test/Object/invalid.test
+++ b/llvm/test/Object/invalid.test
@@ -207,7 +207,7 @@ Sections:
# RUN: yaml2obj %s --docnum=11 -o %t11
# RUN: not llvm-readobj --symbols %t11 2>&1 | FileCheck --check-prefix=INVALID-XINDEX-SIZE %s
-# INVALID-XINDEX-SIZE: error: {{.*}}: SHT_SYMTAB_SHNDX section has sh_size (24) which is not equal to the number of symbols (6)
+# INVALID-XINDEX-SIZE: error: {{.*}}: SHT_SYMTAB_SHNDX section has sh_size (24) which is not equal to the number of symbols (2)
--- !ELF
FileHeader:
@@ -218,8 +218,7 @@ FileHeader:
Sections:
- Name: .symtab_shndx
Type: SHT_SYMTAB_SHNDX
- Size: 0x18
- EntSize: 4
+ Entries: [ 0, 1 ]
Link: .symtab
## Check that llvm-readobj reports an error if the e_phentsize field is broken.
OpenPOWER on IntegriCloud