[mips][mc] Emit R_{MICRO}MIPS_JALR when expanding jal to jalr
authorVladimir Stefanovic <vladimir.stefanovic@rt-rk.com>
Mon, 10 Dec 2018 15:07:36 +0000 (15:07 +0000)
committerVladimir Stefanovic <vladimir.stefanovic@rt-rk.com>
Mon, 10 Dec 2018 15:07:36 +0000 (15:07 +0000)
commit4433f93afe901ecd9cc85706ff9c41b79ccbc725
treee2edb248097d205a9fe91801f6e851ec57443ed0
parent753efe3584b777ce3c0e9a35579eaa3e02609bac
[mips][mc] Emit R_{MICRO}MIPS_JALR when expanding jal to jalr

When replacing jal with jalr, also emit '.reloc R_MIPS_JALR' (R_MICROMIPS_JALR
for micromips). The linker might then be able to turn jalr into a direct
call.
Add '-mips-jalr-reloc' to enable/disable this feature (default is true).

Differential revision: https://reviews.llvm.org/D55292

llvm-svn: 348760
llvm/lib/Target/Mips/AsmParser/MipsAsmParser.cpp
llvm/test/MC/Mips/expansion-jal-sym-pic.s