diff options
Diffstat (limited to 'test/old-elf/Mips/rel-16.test')
-rw-r--r-- | test/old-elf/Mips/rel-16.test | 51 |
1 files changed, 51 insertions, 0 deletions
diff --git a/test/old-elf/Mips/rel-16.test b/test/old-elf/Mips/rel-16.test new file mode 100644 index 0000000000000..24961e8b78ff2 --- /dev/null +++ b/test/old-elf/Mips/rel-16.test @@ -0,0 +1,51 @@ +# Check handling of R_MIPS_16 relocation. + +# RUN: yaml2obj -format=elf %s > %t.o +# RUN: lld -flavor old-gnu -target mipsel -shared -o %t.exe %t.o +# RUN: llvm-objdump -s -t %t.exe | FileCheck %s + +# CHECK: Contents of section .text: +# CHECK-NEXT: 00f0 f0000000 00000000 00000000 +# ^ V = (T1 - 8) = T0 + +# CHECK: SYMBOL TABLE: +# CHECK: 000000f0 g F .text 00000008 T0 +# CHECK: 000000f8 g F .text 00000004 T1 + +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 + Content: "f8ff00000000000000000000" +# ^ T1 +# ^ T0 A := 0xfff8 = -8 + AddressAlign: 16 + Flags: [ SHF_ALLOC, SHF_EXECINSTR ] + +- Name: .rel.text + Type: SHT_REL + Info: .text + AddressAlign: 4 + Relocations: + - Offset: 0 + Symbol: T1 + Type: R_MIPS_16 + +Symbols: + Global: + - Name: T0 + Section: .text + Type: STT_FUNC + Value: 0 + Size: 8 + - Name: T1 + Section: .text + Type: STT_FUNC + Value: 8 + Size: 4 |