1 # RUN: rm -rf %t && mkdir -p %t
2 # RUN: llvm-mc -triple=mips64el-unknown-linux -target-abi n32 -filetype=obj -o %t/test_ELF_N32.o %s
3 # RUN: llc -mtriple=mips64el-unknown-linux -target-abi n32 -filetype=obj -o %t/test_ELF_ExternalFunction_N32.o %S/Inputs/ExternalFunction.ll
4 # RUN: llvm-rtdyld -triple=mips64el-unknown-linux -verify -map-section test_ELF_N32.o,.text=0x1000 -map-section test_ELF_ExternalFunction_N32.o,.text=0x10000 -check=%s %t/test_ELF_N32.o %t/test_ELF_ExternalFunction_N32.o
6 # RUN: llvm-mc -triple=mips64-unknown-linux -target-abi n32 -filetype=obj -o %t/test_ELF_N32.o %s
7 # RUN: llc -mtriple=mips64-unknown-linux -target-abi n32 -filetype=obj -o %t/test_ELF_ExternalFunction_N32.o %S/Inputs/ExternalFunction.ll
8 # RUN: llvm-rtdyld -triple=mips64-unknown-linux -verify -map-section test_ELF_N32.o,.text=0x1000 -map-section test_ELF_ExternalFunction_N32.o,.text=0x10000 -check=%s %t/test_ELF_N32.o %t/test_ELF_ExternalFunction_N32.o
11 # Test R_MIPS_PC32 relocation.
12 # rtdyld-check: *{4}(R_MIPS_PC32) = (foo - R_MIPS_PC32)[31:0]
15 # rtdyld-check: *{4}(R_MIPS_PC32 + 4) = (foo - tmp1)[31:0]
21 .section .mdebug.abi64,"",@progbits
23 .file "ELF_N32_PIC_relocations.ll"
46 # Test R_MIPS_26 relocation.
47 # rtdyld-check: decode_operand(insn1, 0)[27:0] = stub_addr(test_ELF_N32.o/.text, foo)[27:0]
54 # Test R_MIPS_PC16 relocation.
55 # rtdyld-check: decode_operand(insn2, 1)[17:0] = (foo - insn2)[17:0]
71 .size bar, ($func_end0)-bar
92 # $gp register contains address of the .got section + 0x7FF0. 0x7FF0 is
93 # the offset of $gp from the beginning of the .got section. Check that we are
94 # loading address of the page pointer from correct offset. In this case
95 # the page pointer is the first entry in the .got section, so offset will be
97 # rtdyld-check: decode_operand(insn5, 2)[15:0] = 0x8010
99 # Check that the global offset table contains the page pointer.
100 # rtdyld-check: *{4}(section_addr(test_ELF_N32.o, .got)) = (_str + 0x8000) & 0xffff0000
102 ld $
25, %got_page
(_str
)($
1)
104 # Check the offset of _str from the page pointer.
105 # rtdyld-check: decode_operand(insn6, 2)[15:0] = _str[15:0]
107 daddiu $
25, $
25, %got_ofst
(_str
)
109 # Check that we are loading address of var from correct offset. In this case
110 # var is the second entry in the .got section, so offset will be 4 - 0x7FF0.
111 # rtdyld-check: decode_operand(insn7, 2)[15:0] = 0x8014
113 # Check that the global offset table contains the address of the var.
114 # rtdyld-check: *{4}(section_addr(test_ELF_N32.o, .got) + 4) = var
116 ld $
2, %got_disp
(var
)($
1)
119 # Check that we are loading address of bar from correct offset. In this case
120 # bar is the third entry in the .got section, so offset will be 8 - 0x7FF0.
121 # rtdyld-check: decode_operand(insn8, 2)[15:0] = 0x8018
123 # Check that the global offset table contains the address of the bar.
124 # rtdyld-check: *{4}(section_addr(test_ELF_N32.o, .got) + 8) = bar
126 ld $
2, %call16
(bar
)($
1)
145 .size main, ($func_end1)-main
148 .section .rodata.str1.1,"aMS",@progbits,1
156 .section ".note.GNU-stack","",@progbits