brintos

brintos / llvm-project-archived public Read only

0
0
Text · 2.0 KiB · 541d718 Raw
54 lines · plain
1# REQUIRES: mips2 3# Check PLT entries generation in case of using N32 ABI.4 5# RUN: echo "SECTIONS { \6# RUN:         . = 0x10000; .text ALIGN(0x10000) : { *(.text) } \7# RUN:         . = 0x30000; .data                : { *(.data) } \8# RUN:       }" > %t.script9 10# RUN: llvm-mc -filetype=obj -triple=mips64-unknown-linux \11# RUN:         -target-abi n32 %s -o %t1.o12# RUN: llvm-mc -filetype=obj -triple=mips64-unknown-linux \13# RUN:         -target-abi n32 %S/Inputs/mips-dynamic.s -o %t2.o14# RUN: ld.lld %t2.o -shared -soname=t.so -o %t.so15# RUN: ld.lld %t1.o %t.so -script %t.script -o %t.exe16# RUN: llvm-objdump --no-print-imm-hex -d --no-show-raw-insn %t.exe \17# RUN:   | FileCheck %s --check-prefixes=DEFAULT,CHECK18# RUN: ld.lld %t2.o -shared -soname=t.so -o %t.so -z hazardplt19# RUN: ld.lld %t1.o %t.so -script %t.script -o %t.exe -z hazardplt20# RUN: llvm-objdump --no-print-imm-hex -d --no-show-raw-insn %t.exe \21# RUN:   | FileCheck %s --check-prefixes=HAZARDPLT,CHECK22 23# CHECK:      Disassembly of section .text:24# CHECK-EMPTY:25# CHECK-NEXT: <__start>:26# CHECK-NEXT:   20000:       jal     0x2003027#                                    ^-- 0x20030 gotplt[foo0]28# CHECK-NEXT:   20004:       nop29#30# CHECK-EMPTY:31# CHECK-NEXT: Disassembly of section .plt:32# CHECK-EMPTY:33# CHECK-NEXT: <.plt>:34# CHECK-NEXT:   20010:       lui     $14, 335# CHECK-NEXT:   20014:       lw      $25, 4($14)36# CHECK-NEXT:   20018:       addiu   $14, $14, 437# CHECK-NEXT:   2001c:       subu    $24, $24, $1438# CHECK-NEXT:   20020:       move    $15, $ra39# CHECK-NEXT:   20024:       srl     $24, $24, 240# DEFAULT:      20028:       jalr    $2541# HAZARDPLT:    20028:       jalr.hb $2542# CHECK-NEXT:   2002c:       addiu   $24, $24, -243 44# CHECK-NEXT:   20030:       lui     $15, 345# CHECK-NEXT:   20034:       lw      $25, 12($15)46# DEFAULT:      20038:       jr      $2547# HAZARDPLT:    20038:       jr.hb   $2548# CHECK-NEXT:   2003c:       addiu   $24, $15, 1249 50  .text51  .global __start52__start:53  jal foo0        # R_MIPS_26 against 'foo0' from DSO54