diff options
-rw-r--r-- | lld/test/elf/Mips/exe-dynamic.test | 92 |
1 files changed, 76 insertions, 16 deletions
diff --git a/lld/test/elf/Mips/exe-dynamic.test b/lld/test/elf/Mips/exe-dynamic.test index eb1d032ce0f..e659fb41761 100644 --- a/lld/test/elf/Mips/exe-dynamic.test +++ b/lld/test/elf/Mips/exe-dynamic.test @@ -1,15 +1,13 @@ -# REQUIRES: mips - # Check MIPS specific tags in the dynamic table in case executable linking. # Build shared library -# RUN: yaml2obj -format=elf %S/Inputs/pic-obj.yaml > %t-so-obj -# RUN: lld -flavor gnu -target mipsel -shared -o %t-so %t-so-obj +# RUN: yaml2obj -format=elf -docnum 1 %s > %t-so.o +# RUN: lld -flavor gnu -target mipsel -shared -o %t.so %t-so.o # Build executable -# RUN: llvm-mc -triple=mipsel -filetype=obj -o=%t-obj %s -# RUN: lld -flavor gnu -target mipsel -e glob -o %t-exe %t-obj %t-so -# RUN: llvm-readobj -dynamic-table %t-exe | FileCheck %s +# RUN: yaml2obj -format=elf -docnum 2 %s > %t-o.o +# RUN: lld -flavor gnu -target mipsel -e glob -o %t.exe %t-o.o %t.so +# RUN: llvm-readobj -dynamic-table %t.exe | FileCheck %s # CHECK: Format: ELF32-mips # CHECK: Arch: mipsel @@ -39,12 +37,74 @@ # CHECK-NEXT: 0x00000000 NULL 0x0 # CHECK-NEXT: ] - .abicalls - .global glob - .ent glob -loc: - jal T1 -glob: - jal loc - jal glob - .end glob +# so.o +--- +FileHeader: + Class: ELFCLASS32 + Data: ELFDATA2LSB + Type: ET_REL + Machine: EM_MIPS + Flags: [EF_MIPS_PIC, EF_MIPS_CPIC] + +Sections: +- Name: .text + Type: SHT_PROGBITS + Size: 0x0C + AddressAlign: 16 + Flags: [SHF_EXECINSTR, SHF_ALLOC] + +Symbols: + Global: + - Name: T1 + Section: .text + Type: STT_FUNC + Value: 0x0 + Size: 4 + +# o.o +--- +FileHeader: + Class: ELFCLASS32 + Data: ELFDATA2LSB + Type: ET_REL + Machine: EM_MIPS + Flags: [ EF_MIPS_PIC, EF_MIPS_CPIC, + EF_MIPS_ABI_O32, EF_MIPS_ARCH_32 ] +Sections: + - Name: .text + Type: SHT_PROGBITS + Flags: [ SHF_ALLOC, SHF_EXECINSTR ] + AddressAlign: 0x04 + Content: 0000000C000000000000000C000000000000000C00000000 + - Name: .rel.text + Type: SHT_REL + Link: .symtab + AddressAlign: 0x04 + Info: .text + Relocations: + - Offset: 0x00 + Symbol: T1 + Type: R_MIPS_26 + Addend: 0 + - Offset: 0x08 + Symbol: .text + Type: R_MIPS_26 + Addend: 0 + - Offset: 0x10 + Symbol: glob + Type: R_MIPS_26 + Addend: 0 + +Symbols: + Local: + - Name: loc + Section: .text + - Name: .text + Type: STT_SECTION + Section: .text + Global: + - Name: glob + Section: .text + Value: 0x08 + - Name: T1 +... |