diff options
author | Simon Dardis <simon.dardis@imgtec.com> | 2016-11-25 11:06:43 +0000 |
---|---|---|
committer | Simon Dardis <simon.dardis@imgtec.com> | 2016-11-25 11:06:43 +0000 |
commit | c08af6db5b80674a282f5b4438f77689d5b87867 (patch) | |
tree | 6843d4c22ad797ebf658f7fd93295fe087ede5cb /llvm/lib/Target/Mips/AsmParser/MipsAsmParser.cpp | |
parent | 0479957d1a5dc9270b6a22badca6a20a37370d1b (diff) | |
download | bcm5719-llvm-c08af6db5b80674a282f5b4438f77689d5b87867.tar.gz bcm5719-llvm-c08af6db5b80674a282f5b4438f77689d5b87867.zip |
[mips] Correct jal expansion for local symbols in .local directives.
This patch corrects the behaviour of code such as:
.local foo
jal foo
foo:
to use the correct jal expansion when writing ELF files.
Patch by: Daniel Sanders
Reviewers: zoran.jovanovic, seanbruno, vkalintiris
Differential Revision: https://reviews.llvm.org/D24722
llvm-svn: 287918
Diffstat (limited to 'llvm/lib/Target/Mips/AsmParser/MipsAsmParser.cpp')
-rw-r--r-- | llvm/lib/Target/Mips/AsmParser/MipsAsmParser.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/llvm/lib/Target/Mips/AsmParser/MipsAsmParser.cpp b/llvm/lib/Target/Mips/AsmParser/MipsAsmParser.cpp index 1be67ab7cfc..e6234d14bda 100644 --- a/llvm/lib/Target/Mips/AsmParser/MipsAsmParser.cpp +++ b/llvm/lib/Target/Mips/AsmParser/MipsAsmParser.cpp @@ -1806,7 +1806,8 @@ bool MipsAsmParser::processInstruction(MCInst &Inst, SMLoc IDLoc, // FIXME: Add support for label+offset operands (currently causes an error). // FIXME: Add support for forward-declared local symbols. // FIXME: Add expansion for when the LargeGOT option is enabled. - if (JalSym->isInSection() || JalSym->isTemporary()) { + if (JalSym->isInSection() || JalSym->isTemporary() || + (JalSym->isELF() && cast<MCSymbolELF>(JalSym)->getBinding() == ELF::STB_LOCAL)) { if (isABI_O32()) { // If it's a local symbol and the O32 ABI is being used, we expand to: // lw $25, 0($gp) |