summaryrefslogtreecommitdiff
path: root/llvm/test/tools/llvm-elfabi/binary-read-arch.test
diff options
context:
space:
mode:
authorArmando Montanez <amontanez@google.com>2019-01-16 17:47:16 +0000
committerArmando Montanez <amontanez@google.com>2019-01-16 17:47:16 +0000
commit4777a84399a5d745283944ce6cd962442b5f504a (patch)
treebc58c7b3904006a68485a63d39c80cfe50ba207c /llvm/test/tools/llvm-elfabi/binary-read-arch.test
parentf4bf1161c0fc5bb5e2b1bd6f2bfdf954eb2bfad5 (diff)
[elfabi] Add support for reading DT_SONAME from binarieslinaro-local/ci/tcwg_kernel/llvm-master-aarch64-next-allnoconfig
This change gives the llvm-elfabi tool the ability to read DT_SONAME from a binary ELF file into an ELFStub. Added: - DynamicEntries struct for storing dynamic entries that are relevant to elfabi. - terminatedSubstr() retrieves a null-terminated substring from a StringRef. - appendToError() appends a string to an error, allowing more specific error messages. Differential Revision: https://reviews.llvm.org/D55629
Diffstat (limited to 'llvm/test/tools/llvm-elfabi/binary-read-arch.test')
-rw-r--r--llvm/test/tools/llvm-elfabi/binary-read-arch.test34
1 files changed, 33 insertions, 1 deletions
diff --git a/llvm/test/tools/llvm-elfabi/binary-read-arch.test b/llvm/test/tools/llvm-elfabi/binary-read-arch.test
index ecb2fb81446..f2c2d8bd56d 100644
--- a/llvm/test/tools/llvm-elfabi/binary-read-arch.test
+++ b/llvm/test/tools/llvm-elfabi/binary-read-arch.test
@@ -1,5 +1,5 @@
# RUN: yaml2obj %s > %t
-# RUN: llvm-elfabi %t --emit-tbe=- | FileCheck %s
+# RUN: llvm-elfabi --elf %t --emit-tbe=- | FileCheck %s
!ELF
FileHeader:
@@ -7,6 +7,38 @@ FileHeader:
Data: ELFDATA2LSB
Type: ET_DYN
Machine: EM_X86_64
+Sections:
+ - Name: .dynstr
+ Type: SHT_STRTAB
+ Flags: [ SHF_ALLOC ]
+ Address: 0x0000
+ Content: "00"
+ - Name: .dynamic
+ Type: SHT_DYNAMIC
+ Flags: [ SHF_ALLOC ]
+ Address: 0x0008
+ AddressAlign: 8
+ Content: "0a0000000000000001000000000000000500000000000000000000000000000000000000000000000000000000000000"
+ # DT_STRSZ 1 (0x1)
+ # DT_STRTAB 0x0
+ # DT_NULL 0x0
+ Size: 48
+ Link: .dynstr
+ProgramHeaders:
+ - Type: PT_LOAD
+ Flags: [ PF_R ]
+ VAddr: 0x0000
+ PAddr: 0x0000
+ Align: 8
+ Sections:
+ - Section: .dynstr
+ - Section: .dynamic
+ - Type: PT_DYNAMIC
+ Flags: [ PF_X, PF_R ]
+ VAddr: 0x0008
+ PAddr: 0x0008
+ Sections:
+ - Section: .dynamic
# CHECK: --- !tapi-tbe
# CHECK-NEXT: TbeVersion: {{[1-9]\d*\.(0|([1-9]\d*))}}