100 lines · plain
1# REQUIRES: mips2# Check PLT creation for microMIPS to microMIPS calls.3 4# RUN: echo "SECTIONS { \5# RUN: . = 0x20000; .text ALIGN(0x100) : { *(.text) } \6# RUN: . = 0x20300; .plt : { *(.plt) } \7# RUN: }" > %t.script8 9# RUN: llvm-mc -filetype=obj -triple=mips-unknown-linux \10# RUN: -mattr=micromips %S/Inputs/mips-micro.s -o %t1eb.o11# RUN: ld.lld -shared -soname=teb.so -o %teb.so %t1eb.o12# RUN: llvm-mc -filetype=obj -triple=mips-unknown-linux \13# RUN: -mattr=micromips %s -o %t2eb.o14# RUN: ld.lld --script %t.script -o %teb.exe %t2eb.o %teb.so15# RUN: llvm-objdump --no-print-imm-hex -d --mattr=micromips --no-show-raw-insn %teb.exe \16# RUN: | FileCheck --check-prefix=R2 %s17# RUN: llvm-readelf -A %teb.exe | FileCheck --check-prefix=PLT %s18 19# RUN: llvm-mc -filetype=obj -triple=mipsel-unknown-linux \20# RUN: -mattr=micromips %S/Inputs/mips-micro.s -o %t1el.o21# RUN: ld.lld -shared -soname=tel.so -o %tel.so %t1el.o22# RUN: llvm-mc -filetype=obj -triple=mipsel-unknown-linux \23# RUN: -mattr=micromips %s -o %t2el.o24# RUN: ld.lld --script %t.script -o %tel.exe %t2el.o %tel.so25# RUN: llvm-objdump --no-print-imm-hex -d --mattr=micromips --no-show-raw-insn %tel.exe \26# RUN: | FileCheck --check-prefix=R2 %s27# RUN: llvm-readelf -A %tel.exe | FileCheck --check-prefix=PLT %s28 29# RUN: llvm-mc -filetype=obj -triple=mips-unknown-linux \30# RUN: -mattr=micromips -mcpu=mips32r6 %S/Inputs/mips-micro.s -o %t1eb.o31# RUN: ld.lld -shared -soname=teb.so -o %teb.so %t1eb.o32# RUN: llvm-mc -filetype=obj -triple=mips-unknown-linux \33# RUN: -mattr=micromips -mcpu=mips32r6 %s -o %t2eb.o34# RUN: ld.lld --script %t.script -o %teb.exe %t2eb.o %teb.so35# RUN: llvm-objdump --no-print-imm-hex -d --mattr=micromips %teb.exe --no-show-raw-insn \36# RUN: | FileCheck --check-prefix=R6 %s37 38# RUN: llvm-mc -filetype=obj -triple=mipsel-unknown-linux \39# RUN: -mattr=micromips -mcpu=mips32r6 %S/Inputs/mips-micro.s -o %t1el.o40# RUN: ld.lld -shared -soname=tel.so -o %tel.so %t1el.o41# RUN: llvm-mc -filetype=obj -triple=mipsel-unknown-linux \42# RUN: -mattr=micromips -mcpu=mips32r6 %s -o %t2el.o43# RUN: ld.lld --script %t.script -o %tel.exe %t2el.o %tel.so44# RUN: llvm-objdump --no-print-imm-hex -d --mattr=micromips --no-show-raw-insn %tel.exe \45# RUN: | FileCheck --check-prefix=R6 %s46 47# RUN: llvm-mc -filetype=obj -triple=mips-unknown-linux \48# RUN: -mattr=micromips %S/Inputs/mips-micro.s -o %t1eb.o49# RUN: ld.lld -shared -soname=teb.so -o %teb.so %t1eb.o50# RUN: llvm-mc -filetype=obj -triple=mips-unknown-linux \51# RUN: %S/Inputs/mips-fpic.s -o %t-reg.o52# RUN: llvm-mc -filetype=obj -triple=mips-unknown-linux \53# RUN: -mattr=micromips %s -o %t2eb.o54# RUN: ld.lld --script %t.script -o %teb.exe %t-reg.o %t2eb.o %teb.so55# RUN: llvm-objdump --no-print-imm-hex -d --mattr=micromips --no-show-raw-insn %teb.exe \56# RUN: | FileCheck --check-prefix=R2 %s57 58# R2: .plt:59# R2: 20300: addiupc $3, 5260# R2-NEXT: lw $25, 0($3)61# R2-NEXT: subu16 $2, $2, $362# R2-NEXT: srl16 $2, $2, 263# R2-NEXT: addiu $24, $2, -264# R2-NEXT: move $15, $ra65# R2-NEXT: jalrs16 $2566# R2-NEXT: move $gp, $367# R2-NEXT: nop68# R2-NEXT: ...69# R2-NEXT: 20320: addiupc $2, 2870# R2-NEXT: lw $25, 0($2)71# R2-NEXT: jr16 $2572# R2-NEXT: move $24, $273 74# R6: .plt:75# R6: 20300: lapc $3, 5276# R6-NEXT: lw $25, 0($3)77# R6-NEXT: subu16 $2, $2, $378# R6-NEXT: srl16 $2, $2, 279# R6-NEXT: addiu $24, $2, -280# R6-NEXT: move16 $15, $ra81# R6-NEXT: move16 $gp, $382# R6-NEXT: jalr $2583 84# R6: 20320: lapc $2, 2885# R6-NEXT: lw $25, 0($2)86# R6-NEXT: move16 $24, $287# R6-NEXT: jrc16 $2588 89# PLT: PLT GOT:90# PLT: Entries:91# PLT-NEXT: Address Initial Sym.Val. Type Ndx Name92# PLT-NEXT: 0002033c 00020301 00000000 FUNC UND foo93# ^ 0x20320 + 2894 95 .text96 .set micromips97 .global __start98__start:99 jal foo100