diff options
| author | Simon Atanasyan <simon@atanasyan.com> | 2014-06-19 10:18:58 +0000 |
|---|---|---|
| committer | Simon Atanasyan <simon@atanasyan.com> | 2014-06-19 10:18:58 +0000 |
| commit | 825c5992d8cc83856cadc59923adec8a049921f9 (patch) | |
| tree | 39f7f29c09f9e757cbb493fe7517c4b48add6cbc | |
| parent | 7ff5524f7effdb722041581938a3ac665a4b3a43 (diff) | |
| download | bcm5719-llvm-825c5992d8cc83856cadc59923adec8a049921f9.tar.gz bcm5719-llvm-825c5992d8cc83856cadc59923adec8a049921f9.zip | |
[Mips] Make r26-1.test test case independent from external input files.
llvm-svn: 211263
| -rw-r--r-- | lld/test/elf/Mips/r26-1.test | 91 |
1 files changed, 75 insertions, 16 deletions
diff --git a/lld/test/elf/Mips/r26-1.test b/lld/test/elf/Mips/r26-1.test index 0f687400e26..22d8f39b043 100644 --- a/lld/test/elf/Mips/r26-1.test +++ b/lld/test/elf/Mips/r26-1.test @@ -3,17 +3,17 @@ # Check handling of R_MIPS_26 relocation. # Build shared library -# RUN: yaml2obj -format=elf %S/Inputs/pic-obj.yaml > %t-pic-o -# RUN: lld -flavor gnu -target mipsel -shared -o %t-so %t-pic-o +# 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-npic-o %s -# RUN: llvm-readobj -relocations %t-npic-o | \ +# RUN: yaml2obj -format=elf -docnum 2 %s > %t-o.o +# RUN: llvm-readobj -relocations %t-o.o | \ # RUN: FileCheck -check-prefix=OBJ-REL %s -# RUN: lld -flavor gnu -target mipsel -e glob -o %t-exe %t-npic-o %t-so -# RUN: llvm-objdump -section-headers -disassemble %t-exe | \ +# RUN: lld -flavor gnu -target mipsel -e glob -o %t.exe %t-o.o %t.so +# RUN: llvm-objdump -section-headers -disassemble %t.exe | \ # RUN: FileCheck -check-prefix=EXE %s -# RUN: llvm-readobj -relocations %t-exe | FileCheck -check-prefix=EXE-REL %s +# RUN: llvm-readobj -relocations %t.exe | FileCheck -check-prefix=EXE-REL %s # Object file has three R_MIPS_26 relocations # OBJ-REL: Relocations [ @@ -62,12 +62,71 @@ # EXE: 6 .plt 00000030 0000000000400170 TEXT DATA # EXE: 10 .got.plt 0000000c 0000000000402000 DATA - .global glob - .ent glob -glob: - jal $t9 - jal loc -loc: - jal glob - jal T1 - .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_ABI_O32, EF_MIPS_ARCH_32 ] + +Sections: + - Name: .text + Type: SHT_PROGBITS + Flags: [ SHF_ALLOC, SHF_EXECINSTR ] + AddressAlign: 0x04 + Content: '09F82003000000000400000C000000000000000C000000000000000C00000000' + - Name: .rel.text + Type: SHT_REL + Link: .symtab + AddressAlign: 0x04 + Info: .text + Relocations: + - Offset: 0x08 + Symbol: .text + Type: R_MIPS_26 + - Offset: 0x10 + Symbol: glob + Type: R_MIPS_26 + - Offset: 0x18 + Symbol: T1 + Type: R_MIPS_26 + +Symbols: + Local: + - Name: loc + Section: .text + Value: 0x10 + - Name: .text + Type: STT_SECTION + Section: .text + Global: + - Name: glob + Section: .text + - Name: T1 +... |

