Update the lld testsuite for the llvm-readobj format change.

llvm-svn: 178693
This commit is contained in:
Rafael Espindola 2013-04-03 20:53:45 +00:00
parent c01e1b72ad
commit 13de1566d0
4 changed files with 208 additions and 53 deletions

View File

@ -1,11 +1,34 @@
RUN: lld -core -target hexagon %p/Inputs/use-shared.hexagon \
RUN: -output=%t1 -output-type=shared
RUN: llvm-readobj %t1 > %t2
RUN: llvm-readobj -dyn-symbols %t1 > %t2
RUN: FileCheck -check-prefix=DYNSYMS %s < %t2
DYNSYMS: Dynamic Symbols:
DYNSYMS: Name Type Section Address Size FileOffset Flags
DYNSYMS: fn2 FUNC .text {{[0-9a-f]+}} {{[0-9a-f]+}} {{[0-9a-f]+}} global
DYNSYMS: fn1 FUNC .text {{[0-9a-f]+}} {{[0-9a-f]+}} {{[0-9a-f]+}} global
DYNSYMS: fn3 FUNC .text {{[0-9a-f]+}} {{[0-9a-f]+}} {{[0-9a-f]+}} global
DYNSYMS: Total: 3
DYNSYMS: DynamicSymbols [
DYNSYMS: Symbol {
DYNSYMS: Name: fn2
DYNSYMS-NEXT: Value:
DYNSYMS-NEXT: Size:
DYNSYMS-NEXT: Binding: Global
DYNSYMS-NEXT: Type: Function
DYNSYMS-NEXT: Other:
DYNSYMS-NEXT: Section: .text
DYNSYMS: }
DYNSYMS: Symbol {
DYNSYMS: Name: fn1
DYNSYMS-NEXT: Value:
DYNSYMS-NEXT: Size:
DYNSYMS-NEXT: Binding: Global
DYNSYMS-NEXT: Type: Function
DYNSYMS-NEXT: Other:
DYNSYMS-NEXT: Section: .text
DYNSYMS: }
DYNSYMS: Symbol {
DYNSYMS: Name: fn3
DYNSYMS-NEXT: Value:
DYNSYMS-NEXT: Size:
DYNSYMS-NEXT: Binding: Global
DYNSYMS-NEXT: Type: Function
DYNSYMS-NEXT: Other:
DYNSYMS-NEXT: Section: .text
DYNSYMS-NEXT: }
DYNSYMS-NEXT: ]

View File

@ -1,5 +1,10 @@
RUN: lld -core -target x86_64-linux -output=%t %p/Inputs/relocs.x86-64 \
RUN: -output-type=static
RUN: llvm-readobj %t | FileCheck %s
RUN: llvm-readobj -t %t | FileCheck %s
CHECK: i DATA
CHECK: Symbol {
CHECK: Name: i
CHECK-NEXT: Value:
CHECK-NEXT: Size:
CHECK-NEXT: Binding:
CHECK-NEXT: Type: Object

View File

@ -5,7 +5,7 @@ RUN: lld -core -target x86_64-linux %p/Inputs/use-shared.x86-64 \
RUN: %p/Inputs/shared.so-x86-64 -emit-yaml -output=%t2 -noinhibit-exec \
RUN: -output-type=dynamic
RUN: llvm-objdump -p %t >> %t2
RUN: llvm-readobj %t >> %t2
RUN: llvm-readobj -s -dyn-symbols -dynamic-table %t >> %t2
RUN: FileCheck %s < %t2
CHECK: type: got
@ -26,28 +26,51 @@ CHECK: PHDR off 0x{{0+}}40
CHECK: INTERP
CHECK: flags r--
CHECK: Dynamic Symbols:
CHECK: foo FUNC {{[0-9a-f]+}} 0 {{[0-9a-f]+}} undef,global
CHECK: i FUNC {{[0-9a-f]+}} 0 {{[0-9a-f]+}} undef,global
CHECK: Total: 2
CHECK: Section {
CHECK: Name: .hash
CHECK-NEXT: Type: SHT_HASH
CHECK-NEXT: Flags [
CHECK-NEXT: SHF_ALLOC
CHECK-NEXT: ]
CHECK-NEXT: Address:
CHECK-NEXT: Offset:
CHECK-NEXT: Size: 32
CHECK-NEXT: Link:
CHECK-NEXT: Info:
CHECK-NEXT: AddressAlignment: 8
CHECK-NEXT: EntrySize:
CHECK-NEXT: }
CHECK: Sections:
CHECK: .hash {{[0-9a-f]+}} 20 8 required,rodata
CHECK: DynamicSymbols [
CHECK: Symbol {
CHECK: Name: foo
CHECK-NEXT: Value: 0
CHECK-NEXT: Size:
CHECK-NEXT: Binding: Global
CHECK-NEXT: Type: Function
CHECK: }
CHECK: Symbol {
CHECK: Name: i
CHECK-NEXT: Value: 0
CHECK-NEXT: Size:
CHECK-NEXT: Binding: Global
CHECK-NEXT: Type: Function
CHECK: }
CHECK: Dynamic section contains 14 entries
CHECK: DynamicSection [ (14 entries)
CHECK: Tag Type Name/Value
CHECK: 0x0000000000000004 (HASH)
CHECK: 0x0000000000000005 (STRTAB)
CHECK: 0x0000000000000006 (SYMTAB)
CHECK: 0x000000000000000a (STRSZ)
CHECK: 0x000000000000000b (SYMENT) 24
CHECK: 0x0000000000000007 (RELA)
CHECK: 0x0000000000000008 (RELASZ) 24
CHECK: 0x0000000000000009 (RELAENT) 24
CHECK: 0x0000000000000002 (PLTRELSZ) 24
CHECK: 0x0000000000000003 (PLTGOT)
CHECK: 0x0000000000000014 (PLTREL) RELA
CHECK: 0x0000000000000017 (JMPREL)
CHECK: 0x0000000000000001 (NEEDED) Shared library: [shared.so-x86-64]
CHECK: 0x0000000000000000 (NULL) 0x0
CHECK: Total: 14
CHECK: 0x0000000000000004 HASH
CHECK: 0x0000000000000005 STRTAB
CHECK: 0x0000000000000006 SYMTAB
CHECK: 0x000000000000000A STRSZ
CHECK: 0x000000000000000B SYMENT 24
CHECK: 0x0000000000000007 RELA
CHECK: 0x0000000000000008 RELASZ 24
CHECK: 0x0000000000000009 RELAENT 24
CHECK: 0x0000000000000002 PLTRELSZ 24
CHECK: 0x0000000000000003 PLTGOT
CHECK: 0x0000000000000014 PLTREL RELA
CHECK: 0x0000000000000017 JMPREL
CHECK: 0x0000000000000001 NEEDED SharedLibrary (shared.so-x86-64)
CHECK: 0x0000000000000000 NULL 0x0
CHECK: ]

View File

@ -1,7 +1,6 @@
RUN: lld-core -reader ELF -writer ELF -o %t1 %p/Inputs/section-test.i386
RUN: llvm-objdump -section-headers %t1 | FileCheck -check-prefix=OBJDUMP %s
RUN: llvm-readobj %t1 | FileCheck -check-prefix=READOBJ %s
RUN: elf-dump --dump-section %t1 | FileCheck -check-prefix=ED %s
RUN: llvm-readobj -h -s -t %t1 | FileCheck -check-prefix=READOBJ %s
OBJDUMP: 0 00000000 0000000000000000
OBJDUMP: 1 .text 0000000a 0000000000000074 TEXT DATA
@ -13,23 +12,128 @@ OBJDUMP: 6 .shstrtab {{[0-9a-f]+}} 0000000000000000
OBJDUMP: 7 .symtab {{[0-9a-f]+}} 0000000000000000
OBJDUMP: 8 .strtab {{[0-9a-f]+}} 0000000000000000
READOBJ: File Format : ELF32-i386
READOBJ: Arch : i386
READOBJ: Address Size: 32 bits
READOBJ: Symbols
READOBJ: baz FUNC .text 74 a e8 global
READOBJ: y DATA .special 1004 4 2008 global
READOBJ: Format: ELF32-i386
READOBJ: Arch: i386
READOBJ: AddressSize: 32bit
READOBJ: ElfHeader {
READOBJ: Ident {
READOBJ: DataEncoding: LittleEndian (0x1)
READOBJ: }
READOBJ: Machine: EM_386
READOBJ: }
ED: 'e_indent[EI_DATA]', 0x01
ED: 'e_machine', 0x0003
ED: Section 1
ED: 'sh_addralign', 0x00000004
ED: Section 2
ED: 'sh_addralign', 0x00000004
ED: Section 6
ED: 'sh_link', 0x00000000
ED: 'sh_addralign', 0x00000001
ED: Section 7
ED: 'sh_link', 0x00000008
ED: 'sh_addralign', 0x00000004
ED: 'sh_entsize', 0x00000010
READOBJ: Sections [
READOBJ: Section {
READOBJ: Index: 0
READOBJ: Name: (0)
READOBJ: Type: SHT_NULL
READOBJ: Flags [ (0x0)
READOBJ: ]
READOBJ: Address: 0x0
READOBJ: Size: 0
READOBJ: }
READOBJ: Section {
READOBJ: Index: 1
READOBJ: Name: .text
READOBJ: Type: SHT_PROGBITS
READOBJ: Flags [ (0x6)
READOBJ: SHF_ALLOC
READOBJ: SHF_EXECINSTR
READOBJ: ]
READOBJ: Address: 0x74
READOBJ: Size: 10
READOBJ: AddressAlignment: 4
READOBJ: }
READOBJ: Section {
READOBJ: Index: 2
READOBJ: Name: .data
READOBJ: Type: SHT_PROGBITS
READOBJ: Flags [ (0x3)
READOBJ: SHF_ALLOC
READOBJ: SHF_WRITE
READOBJ: ]
READOBJ: Address: 0x1000
READOBJ: Size: 4
READOBJ: AddressAlignment: 4
READOBJ: }
READOBJ: Section {
READOBJ: Index: 3
READOBJ: Name: .special
READOBJ: Type: SHT_PROGBITS
READOBJ: Flags [ (0x3)
READOBJ: SHF_ALLOC
READOBJ: SHF_WRITE
READOBJ: ]
READOBJ: Address: 0x1004
READOBJ: Size: 4
READOBJ: }
READOBJ: Section {
READOBJ: Index: 4
READOBJ: Name: .anotherspecial
READOBJ: Type: SHT_PROGBITS
READOBJ: Flags [ (0x3)
READOBJ: SHF_ALLOC
READOBJ: SHF_WRITE
READOBJ: ]
READOBJ: Address: 0x1008
READOBJ: Size: 4
READOBJ: }
READOBJ: Section {
READOBJ: Index: 5
READOBJ: Name: .bss
READOBJ: Type: SHT_NOBITS
READOBJ: Flags [ (0x3)
READOBJ: SHF_ALLOC
READOBJ: SHF_WRITE
READOBJ: ]
READOBJ: Address: 0x100C
READOBJ: Size: 4
READOBJ: }
READOBJ: Section {
READOBJ: Index: 6
READOBJ: Name: .shstrtab
READOBJ: Type: SHT_STRTAB
READOBJ: Flags [ (0x0)
READOBJ: ]
READOBJ: Address: 0x0
READOBJ: Link: 0
READOBJ: AddressAlignment: 1
READOBJ: }
READOBJ: Section {
READOBJ: Index: 7
READOBJ: Name: .symtab
READOBJ: Type: SHT_SYMTAB
READOBJ: Flags [ (0x0)
READOBJ: ]
READOBJ: Address: 0x0
READOBJ: Link: 8
READOBJ: AddressAlignment: 4
READOBJ: EntrySize: 16
READOBJ: }
READOBJ: Section {
READOBJ: Index: 8
READOBJ: Name: .strtab
READOBJ: Type: SHT_STRTAB
READOBJ: Flags [ (0x0)
READOBJ: ]
READOBJ: Address: 0x0
READOBJ: }
READOBJ: ]
READOBJ: Symbols [
READOBJ: Symbol {
READOBJ: Name: baz
READOBJ: Value: 0x74
READOBJ: Size: 10
READOBJ: Binding: Global
READOBJ: Type: Function
READOBJ: Section: .text
READOBJ: }
READOBJ: Symbol {
READOBJ: Name: y
READOBJ: Value: 0x1004
READOBJ: Size: 4
READOBJ: Binding: Global
READOBJ: Type: Object
READOBJ: Section: .special
READOBJ: }