[PATCH] D81919: [MIPS64] Workaround fixup_Mips_32 for getExprOpValue

hev via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jun 17 02:40:10 PDT 2020


hev added a comment.

In D81919#2097431 <https://reviews.llvm.org/D81919#2097431>, @xiangzhai wrote:

> Just workaround as GNU toolchain:
>
>   $ objdump -dr 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
>      8:	67f90000 	daddiu	t9,ra,0
>   	...
>   			10: R_MIPS_32	main
>   			10: R_MIPS_NONE	*ABS*
>   			10: R_MIPS_NONE	*ABS*
>
>
> The `ExprKind` of  `main - .` is `ExprKind::Binary`, but GNU toolchain treat it as `%lo(main - .)`, because `ORI` and `DADDIU` only have the 16-bit signed immediate!
>
> So just workaround `ExprKind::Binary` to `ExprKind::Target` for BAD relocation directive N64 testcase.


Why not for O32?


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