Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions llvm/lib/Target/Mips/AsmParser/MipsAsmParser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2108,6 +2108,10 @@ bool MipsAsmParser::processInstruction(MCInst &Inst, SMLoc IDLoc,
if ((Opcode == Mips::JAL || Opcode == Mips::JAL_MM) && inPicMode()) {
warnIfNoMacro(IDLoc);

if (!Inst.getOperand(0).isExpr()) {
return Error(IDLoc, "jal needs a symbolic expression in PIC mode");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

gas gives the error message like:

k.s: Assembler messages:
k.s:2: Error: unsupported constant in relocation

I think that we should keep them same.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sounds good, updated to the same message, thank you!

}

const MCExpr *JalExpr = Inst.getOperand(0).getExpr();

// We can do this expansion if there's only 1 symbol in the argument
Expand Down
Loading