mirror of
https://github.com/RPCS3/llvm.git
synced 2024-12-18 01:17:46 +00:00
[mips][microMIPS] Relocate with symbol for micromips symbols
Differential Revision: http://reviews.llvm.org/D6796 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@225008 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
ab63a4c95e
commit
25547ee83c
@ -11,6 +11,7 @@
|
||||
#include "MCTargetDesc/MipsFixupKinds.h"
|
||||
#include "MCTargetDesc/MipsMCTargetDesc.h"
|
||||
#include "llvm/MC/MCAssembler.h"
|
||||
#include "llvm/MC/MCELF.h"
|
||||
#include "llvm/MC/MCELFObjectWriter.h"
|
||||
#include "llvm/MC/MCExpr.h"
|
||||
#include "llvm/MC/MCSection.h"
|
||||
@ -244,8 +245,11 @@ MipsELFObjectWriter::needsRelocateWithSymbol(const MCSymbolData &SD,
|
||||
case ELF::R_MICROMIPS_LO16:
|
||||
return true;
|
||||
|
||||
case ELF::R_MIPS_26:
|
||||
case ELF::R_MIPS_32:
|
||||
if (MCELF::getOther(SD) & (ELF::STO_MIPS_MICROMIPS >> 2))
|
||||
return true;
|
||||
// falltrough
|
||||
case ELF::R_MIPS_26:
|
||||
case ELF::R_MIPS_64:
|
||||
case ELF::R_MIPS_GPREL16:
|
||||
return false;
|
||||
|
16
test/MC/Mips/micromips-func-addr.s
Normal file
16
test/MC/Mips/micromips-func-addr.s
Normal file
@ -0,0 +1,16 @@
|
||||
# RUN: llvm-mc %s -filetype=obj -triple=mipsel-unknown-linux \
|
||||
# RUN: -mattr=micromips | llvm-readobj -r \
|
||||
# RUN: | FileCheck %s -check-prefix=CHECK
|
||||
# CHECK: Relocations [
|
||||
# CHECK: 0x0 R_MIPS_32 bar 0x0
|
||||
# CHECK: 0x4 R_MIPS_32 L1 0x0
|
||||
|
||||
.set micromips
|
||||
.type bar,@function
|
||||
bar:
|
||||
L1:
|
||||
nop
|
||||
.data
|
||||
.4byte bar
|
||||
.4byte L1
|
||||
|
Loading…
Reference in New Issue
Block a user