[PATCH] D81919: [MIPS64] Workaround fixup_Mips_32 for getExprOpValue
hev via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Tue Jun 16 07:42:50 PDT 2020
hev added a comment.
In D81919#2095516 <https://reviews.llvm.org/D81919#2095516>, @xiangzhai wrote:
> Behaviour the same as GNU toolchain:
>
> $ objdump -r t.llvm.o
>
> t.llvm.o: file format elf64-tradlittlemips
>
> RELOCATION RECORDS FOR [.text]:
> OFFSET TYPE VALUE
> 000000000000000c R_MIPS_32 main
> 000000000000000c R_MIPS_NONE *ABS*
> 000000000000000c R_MIPS_NONE *ABS*
>
>
>
> The same ABS value `-4`:
>
> $ objdump -D t.llvm.o
>
> t.llvm.o: file format elf64-tradlittlemips
>
>
> Disassembly of section .text:
>
> 0000000000000000 <main>:
> 0: 00000000 nop
> 4: 67f9fffc daddiu t9,ra,-4
>
>
How about?
.text
main:
nop
daddiu $t9, $ra, main
IIRC, The R_MIPS_PCLO16 means imm = (PC - label) & 65535, but here needs imm = label & 65535, that same as daddiu $t9, $ra, %lo(main). :)
Repository:
rL LLVM
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D81919/new/
https://reviews.llvm.org/D81919
More information about the llvm-commits
mailing list