summaryrefslogtreecommitdiffstats
path: root/llvm/test/Object
diff options
context:
space:
mode:
authorRafael Espindola <rafael.espindola@gmail.com>2016-02-17 15:38:21 +0000
committerRafael Espindola <rafael.espindola@gmail.com>2016-02-17 15:38:21 +0000
commitce2fbddd1903b078e4837e42071e6555b0baecf5 (patch)
treeb82ff1d9b9528a16fb2899f2160a9f7724c28df4 /llvm/test/Object
parenta462b4502f2b6135c2b95ff22f9784c4ce478fe9 (diff)
downloadbcm5719-llvm-ce2fbddd1903b078e4837e42071e6555b0baecf5.tar.gz
bcm5719-llvm-ce2fbddd1903b078e4837e42071e6555b0baecf5.zip
Change how readobj stores info about dynamic symbols.
We used to keep both a section and a pointer to the first symbol. The oddity of keeping a section for dynamic symbols is because there is a DT_SYMTAB but no DT_SYMTABZ, so to print the table we have to find the size via a section table. The reason for still keeping a pointer to the first symbol is because we want to be able to print relocation tables even if the section table is missing (it is mandatory only for files used in linking). With this patch we keep just a DynRegionInfo. This then requires changing a few places that were asking for a Elf_Shdr but actually just needed the first symbol. The test change is to delete the program header pointer. Now that we use the information of both DT_SYMTAB and .dynsym, we don't depend on the sh_entsize of .dynsym if we see DT_SYMTAB. Note: It is questionable if it is worth it putting the effort to report broken sh_entsize given that in files with no section table we have to assume it is sizeof(Elf_Sym), but that is for another change. Extracted from r260488. llvm-svn: 261099
Diffstat (limited to 'llvm/test/Object')
-rwxr-xr-xllvm/test/Object/Inputs/invalid-sh_entsize.elfbin1736 -> 1736 bytes
-rw-r--r--llvm/test/Object/invalid.test4
2 files changed, 3 insertions, 1 deletions
diff --git a/llvm/test/Object/Inputs/invalid-sh_entsize.elf b/llvm/test/Object/Inputs/invalid-sh_entsize.elf
index 9ea80731491..ed501311b29 100755
--- a/llvm/test/Object/Inputs/invalid-sh_entsize.elf
+++ b/llvm/test/Object/Inputs/invalid-sh_entsize.elf
Binary files differ
diff --git a/llvm/test/Object/invalid.test b/llvm/test/Object/invalid.test
index cc5cd68304c..a32c621cca6 100644
--- a/llvm/test/Object/invalid.test
+++ b/llvm/test/Object/invalid.test
@@ -35,9 +35,11 @@ SECTION-NEXT: AddressAlignment:
SECTION-NEXT: EntrySize: 32
RUN: not llvm-readobj -t %p/Inputs/invalid-sh_entsize.elf 2>&1 | FileCheck --check-prefix=INVALID-SYM-SIZE %s
-RUN: not llvm-readobj --dyn-symbols %p/Inputs/invalid-sh_entsize.elf 2>&1 | FileCheck --check-prefix=INVALID-SYM-SIZE %s
INVALID-SYM-SIZE: Invalid symbol size
+RUN: not llvm-readobj --dyn-symbols %p/Inputs/invalid-sh_entsize.elf 2>&1 | FileCheck --check-prefix=INVALID-DYNSYM-SIZE %s
+INVALID-DYNSYM-SIZE: Invalid entity size
+
RUN: not llvm-readobj -t %p/Inputs/invalid-section-index.elf 2>&1 | FileCheck --check-prefix=INVALID-SECTION-INDEX %s
INVALID-SECTION-INDEX: Invalid section index
OpenPOWER on IntegriCloud