brintos

brintos / llvm-project-archived public Read only

0
0
Text · 2.5 KiB · 5492f1c Raw
81 lines · plain
1# REQUIRES: mips2# Check R_MIPS_GOT16 relocation calculation.3 4# RUN: llvm-mc -filetype=obj -triple=mips-unknown-linux %s -o %t.o5# RUN: echo "SECTIONS { \6# RUN:         . = 0x1000;  .text ALIGN(0x1000) : { *(.text) } \7# RUN:         . = 0x3000;  .data : { *(.data) } \8# RUN:       }" > %t.script9# RUN: ld.lld %t.o -shared --script %t.script -o %t.so10# RUN: llvm-objdump --no-print-imm-hex -d -t --no-show-raw-insn %t.so | FileCheck %s11# RUN: llvm-readelf -r -A %t.so | FileCheck -check-prefix=GOT %s12 13# CHECK: SYMBOL TABLE:14# CHECK: 00024008 l       .data           00000000 .hidden bar15# CHECK: 00000000         *UND*           00000000 foo16 17# CHECK:       <__start>:18# CHECK-NEXT:    lw      $8, -32744($gp)19# CHECK-NEXT:    addi    $8, $8, 823620# CHECK-NEXT:    lw      $8, -32732($gp)21# CHECK-NEXT:    addi    $8, $8, -1638422# CHECK-NEXT:    lw      $8, -32728($gp)23# CHECK-NEXT:    addi    $8, $8, -1638024# CHECK-NEXT:    lw      $8, -32728($gp)25# CHECK-NEXT:    addi    $8, $8, 1638826# CHECK-NEXT:    lw      $8, -32720($gp)27# CHECK-NEXT:    addi    $8, $8, 1639228# CHECK-NEXT:    lw      $8, -32716($gp)29 30# GOT: There are no relocations in this file.31 32# GOT:       Local entries:33# GOT-NEXT:        Access  Initial34# GOT-NEXT:   -32744(gp) 0000000035#                        ^-- (0x2000 + 0x8000) & ~0xffff36# GOT-NEXT:   -32740(gp) 0001000037#                        ^-- redundant unused entry38# GOT-NEXT:   -32736(gp) 0000000039#                        ^-- redundant unused entry40# GOT-NEXT:   -32732(gp) 0001000041#                        ^-- (0x3000 + 0x9000 + 0x8000) & ~0xffff42# GOT-NEXT:   -32728(gp) 0002000043#                        ^-- (0x3000 + 0x9000 + 0x10004 + 0x8000) & ~0xffff44#                        ^-- (0x3000 + 0x9000 + 0x18004 + 0x8000) & ~0xffff45# GOT-NEXT:   -32724(gp) 0003000046#                        ^-- redundant unused entry47# GOT-NEXT:   -32720(gp) 0002400848#                        ^-- 'bar' address49# GOT-EMPTY:50# GOT-NEXT:  Global entries:51# GOT-NEXT:       Access  Initial Sym.Val. Type    Ndx Name52# GOT-NEXT:   -32716(gp) 00000000 00000000 NOTYPE  UND foo53 54  .text55  .globl  __start56__start:57  lw      $t0,%got($LC0)($gp)58  addi    $t0,$t0,%lo($LC0)59  lw      $t0,%got($LC1)($gp)60  addi    $t0,$t0,%lo($LC1)61  lw      $t0,%got($LC1+0x10004)($gp)62  addi    $t0,$t0,%lo($LC1+0x10004)63  lw      $t0,%got($LC1+0x18004)($gp)64  addi    $t0,$t0,%lo($LC1+0x18004)65  lw      $t0,%got(bar)($gp)66  addi    $t0,$t0,%lo(bar)67  lw      $t0,%got(foo)($gp)68$LC0:69  nop70 71  .data72  .space 0x900073$LC1:74  .word 075  .space 0x1800076  .word 077.global bar78.hidden bar79bar:80  .word 081