From 5048514c208a2180933b090251c36d78c9ae119d Mon Sep 17 00:00:00 2001 From: Simon Atanasyan Date: Mon, 12 Dec 2016 17:40:26 +0000 Subject: [PATCH] [mips] For PIC code convert unconditional jump to unconditional branch Unconditional branch uses relative addressing which is the right choice in case of position independent code. This is a fix for the bug: https://dmz-portal.mips.com/bugz/show_bug.cgi?id=2445 Differential revision: https://reviews.llvm.org/D27483 llvm-svn: 289448 --- llvm/lib/Target/Mips/AsmParser/MipsAsmParser.cpp | 11 ++ llvm/test/MC/Mips/expansion-j-sym-pic.s | 139 +++++++++++++++++++++++ llvm/test/MC/Mips/expansion-jal-sym-pic.s | 138 +++++++++++----------- 3 files changed, 218 insertions(+), 70 deletions(-) create mode 100644 llvm/test/MC/Mips/expansion-j-sym-pic.s diff --git a/llvm/lib/Target/Mips/AsmParser/MipsAsmParser.cpp b/llvm/lib/Target/Mips/AsmParser/MipsAsmParser.cpp index e6234d14b..97ca11c 100644 --- a/llvm/lib/Target/Mips/AsmParser/MipsAsmParser.cpp +++ b/llvm/lib/Target/Mips/AsmParser/MipsAsmParser.cpp @@ -1786,6 +1786,17 @@ bool MipsAsmParser::processInstruction(MCInst &Inst, SMLoc IDLoc, } } + // For PIC code convert unconditional jump to unconditional branch. + if ((Inst.getOpcode() == Mips::J || Inst.getOpcode() == Mips::J_MM) && + inPicMode()) { + MCInst BInst; + BInst.setOpcode(inMicroMipsMode() ? Mips::BEQ_MM : Mips::BEQ); + BInst.addOperand(MCOperand::createReg(Mips::ZERO)); + BInst.addOperand(MCOperand::createReg(Mips::ZERO)); + BInst.addOperand(Inst.getOperand(0)); + Inst = BInst; + } + // This expansion is not in a function called by tryExpandInstruction() // because the pseudo-instruction doesn't have a distinct opcode. if ((Inst.getOpcode() == Mips::JAL || Inst.getOpcode() == Mips::JAL_MM) && diff --git a/llvm/test/MC/Mips/expansion-j-sym-pic.s b/llvm/test/MC/Mips/expansion-j-sym-pic.s new file mode 100644 index 0000000..b22d60c --- /dev/null +++ b/llvm/test/MC/Mips/expansion-j-sym-pic.s @@ -0,0 +1,139 @@ +# RUN: llvm-mc %s -arch=mips -mcpu=mips32 -show-encoding |\ +# RUN: FileCheck %s -check-prefix=NORMAL + +# RUN: llvm-mc %s -arch=mips -mcpu=mips64 -target-abi n32 -show-encoding |\ +# RUN: FileCheck %s -check-prefix=NORMAL + +# RUN: llvm-mc %s -arch=mips64 -mcpu=mips64 -target-abi n64 -show-encoding |\ +# RUN: FileCheck %s -check-prefix=NORMAL + +# RUN: llvm-mc %s -arch=mips -mcpu=mips32 -mattr=micromips -show-encoding |\ +# RUN: FileCheck %s -check-prefix=MICRO + +# RUN: llvm-mc %s -arch=mips64 -mcpu=mips64 -target-abi n32 -mattr=micromips -show-encoding |\ +# RUN: FileCheck %s -check-prefix=MICRO + +# RUN: llvm-mc %s -arch=mips64 -mcpu=mips64 -target-abi n64 -mattr=micromips -show-encoding |\ +# RUN: FileCheck %s -check-prefix=MICRO + +# Repeat the tests using ELF output. + +# RUN: llvm-mc %s -arch=mips -mcpu=mips32 -filetype=obj | \ +# RUN: llvm-objdump -d -r - | FileCheck %s -check-prefixes=ELF-O32 +# RUN: llvm-mc %s -arch=mips64 -mcpu=mips64 -target-abi n32 -filetype=obj | \ +# RUN: llvm-objdump -d -r - | FileCheck %s -check-prefixes=ELF-NXX +# RUN: llvm-mc %s -arch=mips64 -mcpu=mips64 -target-abi n64 -filetype=obj | \ +# RUN: llvm-objdump -d -r - | FileCheck %s -check-prefixes=ELF-NXX + + .weak weak_label + + .text + .option pic2 + + .ent local_label +local_label: + .frame $sp, 0, $ra + .set noreorder + + j local_label + nop + +# NORMAL: b local_label # encoding: [0x10,0x00,A,A] +# NORMAL: # fixup A - offset: 0, value: local_label-4, kind: fixup_Mips_PC16 + +# MICRO: b local_label # encoding: [0x94,0x00,A,A] +# MICRO: # fixup A - offset: 0, value: local_label, kind: fixup_MICROMIPS_PC16_S1 + +# ELF-O32: 10 00 ff ff b 0 + +# ELF-NXX: 10 00 ff ff b 0 + + j weak_label + nop + +# NORMAL: b weak_label # encoding: [0x10,0x00,A,A] +# NORMAL: # fixup A - offset: 0, value: weak_label-4, kind: fixup_Mips_PC16 + +# MICRO: b weak_label # encoding: [0x94,0x00,A,A] +# MICRO: # fixup A - offset: 0, value: weak_label, kind: fixup_MICROMIPS_PC16_S1 + +# ELF-O32: 10 00 ff ff b 0 +# ELF-O32-NEXT: R_MIPS_PC16 weak_label + +# ELF-NXX: 10 00 00 00 b 4 +# ELF-NXX-NEXT: R_MIPS_PC16/R_MIPS_NONE/R_MIPS_NONE weak_label + + j global_label + nop + +# NORMAL: b global_label # encoding: [0x10,0x00,A,A] +# NORMAL: # fixup A - offset: 0, value: global_label-4, kind: fixup_Mips_PC16 + +# MICRO: b global_label # encoding: [0x94,0x00,A,A] +# MICRO: # fixup A - offset: 0, value: global_label, kind: fixup_MICROMIPS_PC16_S1 + +# ELF-O32: 10 00 ff ff b 0 +# ELF-O32-NEXT: 00000010: R_MIPS_PC16 global_label + +# ELF-NXX: 10 00 00 00 b 4 +# ELF-NXX-NEXT: R_MIPS_PC16/R_MIPS_NONE/R_MIPS_NONE global_label + + j .text + nop + +# NORMAL: b .text # encoding: [0x10,0x00,A,A] +# NORMAL: # fixup A - offset: 0, value: .text-4, kind: fixup_Mips_PC16 + +# MICRO: b .text # encoding: [0x94,0x00,A,A] +# MICRO: # fixup A - offset: 0, value: .text, kind: fixup_MICROMIPS_PC16_S1 + +# ELF-O32: 10 00 ff ff b 0 +# ELF-O32-NEXT: 00000018: R_MIPS_PC16 .text + +# ELF-NXX: 10 00 00 00 b 4 +# ELF-NXX-NEXT: R_MIPS_PC16/R_MIPS_NONE/R_MIPS_NONE .text + + j 1f + nop + +# NORMAL: b {{.*}}tmp0{{.*}} # encoding: [0x10,0x00,A,A] +# NORMAL: # fixup A - offset: 0, value: {{.*}}tmp0{{.*}}-4, kind: fixup_Mips_PC16 + +# MICRO: b {{.*}}tmp0{{.*}} # encoding: [0x94,0x00,A,A] +# MICRO: # fixup A - offset: 0, value: {{.*}}tmp0{{.*}}, kind: fixup_MICROMIPS_PC16_S1 + +# ELF-O32: 10 00 00 04 b 20 + +# ELF-NXX: 10 00 00 04 b 20 + + .local forward_local + j forward_local + nop + +# NORMAL: b forward_local # encoding: [0x10,0x00,A,A] +# NORMAL: # fixup A - offset: 0, value: forward_local-4, kind: fixup_Mips_PC16 + +# MICRO: b forward_local # encoding: [0x94,0x00,A,A] +# MICRO: # fixup A - offset: 0, value: forward_local, kind: fixup_MICROMIPS_PC16_S1 + +# ELF-O32: 10 00 00 04 b 20 + +# ELF-NXX: 10 00 00 04 b 20 + + j 0x4 + +# NORMAL: b 4 # encoding: [0x10,0x00,0x00,0x01] + +# MICRO: b 4 # encoding: [0x94,0x00,0x00,0x02] + +# ELF-O32: 10 00 00 01 b 8 + +# ELF-NXX: 10 00 00 01 b 8 + + .end local_label + +1: + nop + nop +forward_local: + diff --git a/llvm/test/MC/Mips/expansion-jal-sym-pic.s b/llvm/test/MC/Mips/expansion-jal-sym-pic.s index 8022f247..d188101 100644 --- a/llvm/test/MC/Mips/expansion-jal-sym-pic.s +++ b/llvm/test/MC/Mips/expansion-jal-sym-pic.s @@ -1,20 +1,20 @@ # RUN: llvm-mc %s -arch=mips -mcpu=mips32 -show-encoding |\ -# RUN: FileCheck %s -check-prefixes=ALL,NORMAL,O32 +# RUN: FileCheck %s -check-prefixes=ALL,MIPS,O32 # RUN: llvm-mc %s -arch=mips -mcpu=mips64 -target-abi n32 -show-encoding |\ -# RUN: FileCheck %s -check-prefixes=ALL,NORMAL,N32 +# RUN: FileCheck %s -check-prefixes=ALL,MIPS,N32 # RUN: llvm-mc %s -arch=mips64 -mcpu=mips64 -target-abi n64 -show-encoding |\ -# RUN: FileCheck %s -check-prefixes=ALL,NORMAL,N64 +# RUN: FileCheck %s -check-prefixes=ALL,MIPS,N64 # RUN: llvm-mc %s -arch=mips -mcpu=mips32 -mattr=micromips -show-encoding |\ -# RUN: FileCheck %s -check-prefixes=ALL,MICROMIPS,O32-MICROMIPS +# RUN: FileCheck %s -check-prefixes=ALL,MM,O32-MM # RUN: llvm-mc %s -arch=mips64 -mcpu=mips64 -target-abi n32 -mattr=micromips -show-encoding |\ -# RUN: FileCheck %s -check-prefixes=ALL,MICROMIPS,N32-MICROMIPS +# RUN: FileCheck %s -check-prefixes=ALL,MM,N32-MM # RUN: llvm-mc %s -arch=mips64 -mcpu=mips64 -target-abi n64 -mattr=micromips -show-encoding |\ -# RUN: FileCheck %s -check-prefixes=ALL,MICROMIPS,N64-MICROMIPS +# RUN: FileCheck %s -check-prefixes=ALL,MM,N64-MM # Repeat the tests but using ELF output. An initial version of this patch did # this as the output different depending on whether it went through @@ -63,20 +63,20 @@ local_label: # ELF-N64: df 99 00 00 ld $25, 0($gp) # ELF-N64-NEXT: R_MIPS_GOT_DISP/R_MIPS_NONE/R_MIPS_NONE local_label -# O32-MICROMIPS: lw $25, %got(local_label)($gp) # encoding: [0xff,0x3c,A,A] -# O32-MICROMIPS: # fixup A - offset: 0, value: %got(local_label), kind: fixup_MICROMIPS_GOT16 -# O32-MICROMIPS: addiu $25, $25, %lo(local_label) # encoding: [0x33,0x39,A,A] -# O32-MICROMIPS: # fixup A - offset: 0, value: %lo(local_label), kind: fixup_MICROMIPS_LO16 +# O32-MM: lw $25, %got(local_label)($gp) # encoding: [0xff,0x3c,A,A] +# O32-MM: # fixup A - offset: 0, value: %got(local_label), kind: fixup_MICROMIPS_GOT16 +# O32-MM: addiu $25, $25, %lo(local_label) # encoding: [0x33,0x39,A,A] +# O32-MM: # fixup A - offset: 0, value: %lo(local_label), kind: fixup_MICROMIPS_LO16 -# N32-MICROMIPS: lw $25, %got_disp(local_label)($gp) # encoding: [0xff,0x3c,A,A] -# N32-MICROMIPS: # fixup A - offset: 0, value: %got_disp(local_label), kind: fixup_MICROMIPS_GOT_DISP +# N32-MM: lw $25, %got_disp(local_label)($gp) # encoding: [0xff,0x3c,A,A] +# N32-MM: # fixup A - offset: 0, value: %got_disp(local_label), kind: fixup_MICROMIPS_GOT_DISP -# N64-MICROMIPS: ld $25, %got_disp(local_label)($gp) # encoding: [0xdf,0x99,A,A] -# N64-MICROMIPS: # fixup A - offset: 0, value: %got_disp(local_label), kind: fixup_MICROMIPS_GOT_DISP +# N64-MM: ld $25, %got_disp(local_label)($gp) # encoding: [0xdf,0x99,A,A] +# N64-MM: # fixup A - offset: 0, value: %got_disp(local_label), kind: fixup_MICROMIPS_GOT_DISP -# NORMAL: jalr $25 # encoding: [0x03,0x20,0xf8,0x09] -# MICROMIPS: jalr $ra, $25 # encoding: [0x03,0xf9,0x0f,0x3c] -# ALL: nop # encoding: [0x00,0x00,0x00,0x00] +# MIPS: jalr $25 # encoding: [0x03,0x20,0xf8,0x09] +# MM: jalr $ra, $25 # encoding: [0x03,0xf9,0x0f,0x3c] +# ALL: nop # encoding: [0x00,0x00,0x00,0x00] jal weak_label nop @@ -100,18 +100,18 @@ local_label: # ELF-N64: df 99 00 00 ld $25, 0($gp) # ELF-N64-NEXT: R_MIPS_CALL16/R_MIPS_NONE/R_MIPS_NONE weak_label -# O32-MICROMIPS: lw $25, %call16(weak_label)($gp) # encoding: [0xff,0x3c,A,A] -# O32-MICROMIPS: # fixup A - offset: 0, value: %call16(weak_label), kind: fixup_MICROMIPS_CALL16 +# O32-MM: lw $25, %call16(weak_label)($gp) # encoding: [0xff,0x3c,A,A] +# O32-MM: # fixup A - offset: 0, value: %call16(weak_label), kind: fixup_MICROMIPS_CALL16 -# N32-MICROMIPS: lw $25, %call16(weak_label)($gp) # encoding: [0xff,0x3c,A,A] -# N32-MICROMIPS: # fixup A - offset: 0, value: %call16(weak_label), kind: fixup_MICROMIPS_CALL16 +# N32-MM: lw $25, %call16(weak_label)($gp) # encoding: [0xff,0x3c,A,A] +# N32-MM: # fixup A - offset: 0, value: %call16(weak_label), kind: fixup_MICROMIPS_CALL16 -# N64-MICROMIPS: ld $25, %call16(weak_label)($gp) # encoding: [0xdf,0x99,A,A] -# N64-MICROMIPS: # fixup A - offset: 0, value: %call16(weak_label), kind: fixup_MICROMIPS_CALL16 +# N64-MM: ld $25, %call16(weak_label)($gp) # encoding: [0xdf,0x99,A,A] +# N64-MM: # fixup A - offset: 0, value: %call16(weak_label), kind: fixup_MICROMIPS_CALL16 -# NORMAL: jalr $25 # encoding: [0x03,0x20,0xf8,0x09] -# MICROMIPS: jalr $ra, $25 # encoding: [0x03,0xf9,0x0f,0x3c] -# ALL: nop # encoding: [0x00,0x00,0x00,0x00] +# MIPS: jalr $25 # encoding: [0x03,0x20,0xf8,0x09] +# MM: jalr $ra, $25 # encoding: [0x03,0xf9,0x0f,0x3c] +# ALL: nop # encoding: [0x00,0x00,0x00,0x00] jal global_label nop @@ -135,18 +135,18 @@ local_label: # ELF-N64: df 99 00 00 ld $25, 0($gp) # ELF-N64-NEXT: R_MIPS_CALL16/R_MIPS_NONE/R_MIPS_NONE global_label -# O32-MICROMIPS: lw $25, %call16(global_label)($gp) # encoding: [0xff,0x3c,A,A] -# O32-MICROMIPS: # fixup A - offset: 0, value: %call16(global_label), kind: fixup_MICROMIPS_CALL16 +# O32-MM: lw $25, %call16(global_label)($gp) # encoding: [0xff,0x3c,A,A] +# O32-MM: # fixup A - offset: 0, value: %call16(global_label), kind: fixup_MICROMIPS_CALL16 -# N32-MICROMIPS: lw $25, %call16(global_label)($gp) # encoding: [0xff,0x3c,A,A] -# N32-MICROMIPS: # fixup A - offset: 0, value: %call16(global_label), kind: fixup_MICROMIPS_CALL16 +# N32-MM: lw $25, %call16(global_label)($gp) # encoding: [0xff,0x3c,A,A] +# N32-MM: # fixup A - offset: 0, value: %call16(global_label), kind: fixup_MICROMIPS_CALL16 -# N64-MICROMIPS: ld $25, %call16(global_label)($gp) # encoding: [0xdf,0x99,A,A] -# N64-MICROMIPS: # fixup A - offset: 0, value: %call16(global_label), kind: fixup_MICROMIPS_CALL16 +# N64-MM: ld $25, %call16(global_label)($gp) # encoding: [0xdf,0x99,A,A] +# N64-MM: # fixup A - offset: 0, value: %call16(global_label), kind: fixup_MICROMIPS_CALL16 -# NORMAL: jalr $25 # encoding: [0x03,0x20,0xf8,0x09] -# MICROMIPS: jalr $ra, $25 # encoding: [0x03,0xf9,0x0f,0x3c] -# ALL: nop # encoding: [0x00,0x00,0x00,0x00] +# MIPS: jalr $25 # encoding: [0x03,0x20,0xf8,0x09] +# MM: jalr $ra, $25 # encoding: [0x03,0xf9,0x0f,0x3c] +# ALL: nop # encoding: [0x00,0x00,0x00,0x00] jal .text nop @@ -172,20 +172,20 @@ local_label: # ELF-N64: df 99 00 00 ld $25, 0($gp) # ELF-N64-NEXT: R_MIPS_CALL16/R_MIPS_NONE/R_MIPS_NONE .text -# O32-MICROMIPS-FIXME: lw $25, %got(.text)($gp) # encoding: [0xff,0x3c,A,A] -# O32-MICROMIPS-FIXME: # fixup A - offset: 0, value: %got(.text), kind: fixup_MICROMIPS_GOT16 -# O32-MICROMIPS-FIXME: addiu $25, $25, %lo(.text) # encoding: [0x33,0x39,A,A] -# O32-MICROMIPS-FIXME: # fixup A - offset: 0, value: %lo(.text), kind: fixup_MICROMIPS_LO16 +# O32-MM-FIXME: lw $25, %got(.text)($gp) # encoding: [0xff,0x3c,A,A] +# O32-MM-FIXME: # fixup A - offset: 0, value: %got(.text), kind: fixup_MICROMIPS_GOT16 +# O32-MM-FIXME: addiu $25, $25, %lo(.text) # encoding: [0x33,0x39,A,A] +# O32-MM-FIXME: # fixup A - offset: 0, value: %lo(.text), kind: fixup_MICROMIPS_LO16 -# N32-MICROMIPS-FIXME: lw $25, %got_disp(.text)($gp) # encoding: [0xff,0x3c,A,A] -# N32-MICROMIPS-FIXME: # fixup A - offset: 0, value: %got_disp(.text), kind: fixup_MICROMIPS_GOT_DISP +# N32-MM-FIXME: lw $25, %got_disp(.text)($gp) # encoding: [0xff,0x3c,A,A] +# N32-MM-FIXME: # fixup A - offset: 0, value: %got_disp(.text), kind: fixup_MICROMIPS_GOT_DISP -# N64-MICROMIPS-FIXME: ld $25, %got_disp(.text)($gp) # encoding: [0xdf,0x99,A,A] -# N64-MICROMIPS-FIXME: # fixup A - offset: 0, value: %got_disp(.text), kind: fixup_MICROMIPS_GOT_DISP +# N64-MM-FIXME: ld $25, %got_disp(.text)($gp) # encoding: [0xdf,0x99,A,A] +# N64-MM-FIXME: # fixup A - offset: 0, value: %got_disp(.text), kind: fixup_MICROMIPS_GOT_DISP -# NORMAL: jalr $25 # encoding: [0x03,0x20,0xf8,0x09] -# MICROMIPS: jalr $ra, $25 # encoding: [0x03,0xf9,0x0f,0x3c] -# ALL: nop # encoding: [0x00,0x00,0x00,0x00] +# MIPS: jalr $25 # encoding: [0x03,0x20,0xf8,0x09] +# MM: jalr $ra, $25 # encoding: [0x03,0xf9,0x0f,0x3c] +# ALL: nop # encoding: [0x00,0x00,0x00,0x00] # local labels ($tmp symbols) jal 1f @@ -214,20 +214,20 @@ local_label: # ELF-N64: df 99 00 00 ld $25, 0($gp) # ELF-N64-NEXT: R_MIPS_GOT_DISP/R_MIPS_NONE/R_MIPS_NONE .Ltmp0 -# O32-MICROMIPS: lw $25, %got($tmp0)($gp) # encoding: [0xff,0x3c,A,A] -# O32-MICROMIPS: # fixup A - offset: 0, value: %got($tmp0), kind: fixup_MICROMIPS_GOT16 -# O32-MICROMIPS: addiu $25, $25, %lo($tmp0) # encoding: [0x33,0x39,A,A] -# O32-MICROMIPS: # fixup A - offset: 0, value: %lo($tmp0), kind: fixup_MICROMIPS_LO16 +# O32-MM: lw $25, %got($tmp0)($gp) # encoding: [0xff,0x3c,A,A] +# O32-MM: # fixup A - offset: 0, value: %got($tmp0), kind: fixup_MICROMIPS_GOT16 +# O32-MM: addiu $25, $25, %lo($tmp0) # encoding: [0x33,0x39,A,A] +# O32-MM: # fixup A - offset: 0, value: %lo($tmp0), kind: fixup_MICROMIPS_LO16 -# N32-MICROMIPS: lw $25, %got_disp(.Ltmp0)($gp) # encoding: [0xff,0x3c,A,A] -# N32-MICROMIPS: # fixup A - offset: 0, value: %got_disp(.Ltmp0), kind: fixup_MICROMIPS_GOT_DISP +# N32-MM: lw $25, %got_disp(.Ltmp0)($gp) # encoding: [0xff,0x3c,A,A] +# N32-MM: # fixup A - offset: 0, value: %got_disp(.Ltmp0), kind: fixup_MICROMIPS_GOT_DISP -# N64-MICROMIPS: ld $25, %got_disp(.Ltmp0)($gp) # encoding: [0xdf,0x99,A,A] -# N64-MICROMIPS: # fixup A - offset: 0, value: %got_disp(.Ltmp0), kind: fixup_MICROMIPS_GOT_DISP +# N64-MM: ld $25, %got_disp(.Ltmp0)($gp) # encoding: [0xdf,0x99,A,A] +# N64-MM: # fixup A - offset: 0, value: %got_disp(.Ltmp0), kind: fixup_MICROMIPS_GOT_DISP -# NORMAL: jalr $25 # encoding: [0x03,0x20,0xf8,0x09] -# MICROMIPS: jalr $ra, $25 # encoding: [0x03,0xf9,0x0f,0x3c] -# ALL: nop # encoding: [0x00,0x00,0x00,0x00] +# MIPS: jalr $25 # encoding: [0x03,0x20,0xf8,0x09] +# MM: jalr $ra, $25 # encoding: [0x03,0xf9,0x0f,0x3c] +# ALL: nop # encoding: [0x00,0x00,0x00,0x00] .local forward_local jal forward_local @@ -256,21 +256,20 @@ local_label: # ELF-N64: df 99 00 00 ld $25, 0($gp) # ELF-N64-NEXT: R_MIPS_GOT_DISP/R_MIPS_NONE/R_MIPS_NONE forward_local -# O32-MICROMIPS-FIXME: lw $25, %got(forward_local)($gp) # encoding: [0xff,0x3c,A,A] -# O32-MICROMIPS-FIXME: # fixup A - offset: 0, value: %got(forward_local), kind: fixup_MICROMIPS_GOT16 -# O32-MICROMIPS-FIXME: addiu $25, $25, %lo(forward_local) # encoding: [0x33,0x39,A,A] -# O32-MICROMIPS-FIXME: # fixup A - offset: 0, value: %lo(forward_local), kind: fixup_MICROMIPS_LO16 +# O32-MM-FIXME: lw $25, %got(forward_local)($gp) # encoding: [0xff,0x3c,A,A] +# O32-MM-FIXME: # fixup A - offset: 0, value: %got(forward_local), kind: fixup_MICROMIPS_GOT16 +# O32-MM-FIXME: addiu $25, $25, %lo(forward_local) # encoding: [0x33,0x39,A,A] +# O32-MM-FIXME: # fixup A - offset: 0, value: %lo(forward_local), kind: fixup_MICROMIPS_LO16 -# N32-MICROMIPS-FIXME: lw $25, %got_disp(forward_local)($gp) # encoding: [0xff,0x3c,A,A] -# N32-MICROMIPS-FIXME: # fixup A - offset: 0, value: %got_disp(forward_local), kind: fixup_MICROMIPS_GOT_DISP +# N32-MM-FIXME: lw $25, %got_disp(forward_local)($gp) # encoding: [0xff,0x3c,A,A] +# N32-MM-FIXME: # fixup A - offset: 0, value: %got_disp(forward_local), kind: fixup_MICROMIPS_GOT_DISP -# N64-MICROMIPS-FIXME: ld $25, %got_disp(forward_local)($gp) # encoding: [0xdf,0x99,A,A] -# N64-MICROMIPS-FIXME: # fixup A - offset: 0, value: %got_disp(forward_local), kind: fixup_MICROMIPS_GOT_DISP - -# NORMAL: jalr $25 # encoding: [0x03,0x20,0xf8,0x09] -# MICROMIPS: jalr $ra, $25 # encoding: [0x03,0xf9,0x0f,0x3c] -# ALL: nop # encoding: [0x00,0x00,0x00,0x00] +# N64-MM-FIXME: ld $25, %got_disp(forward_local)($gp) # encoding: [0xdf,0x99,A,A] +# N64-MM-FIXME: # fixup A - offset: 0, value: %got_disp(forward_local), kind: fixup_MICROMIPS_GOT_DISP +# MIPS: jalr $25 # encoding: [0x03,0x20,0xf8,0x09] +# MM: jalr $ra, $25 # encoding: [0x03,0xf9,0x0f,0x3c] +# ALL: nop # encoding: [0x00,0x00,0x00,0x00] .end local_label @@ -279,4 +278,3 @@ local_label: add $8, $8, $8 nop forward_local: - -- 2.7.4