mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2025-01-07 11:51:13 +00:00
[mips][microMIPS] Relocate with symbol for micromips symbols
Differential Revision: http://reviews.llvm.org/D6796 llvm-svn: 225008
This commit is contained in:
parent
a76ddd9ae4
commit
a9daa0cdb9
@ -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