KanRobert wrote:

> Suppress EGPR/NDD instructions for relocations to avoid APX relocation types 
> emitted. This is to keep backward compatibility with old version of ld and 
> other linkers without APX support. If there are APX relocation types, old 
> version of linkers would raise "unsupported relocation type" error. Example:
> 
> ```
> $ llvm-mc -filetype=obj -o got.o -triple=x86_64-unknown-linux got.s
> $ ld got.o -o got.exe
> ld: got.o: unsupported relocation type 0x2b
> ...
> 
> $ cat got.s
> ...
> movq foo@GOTPCREL(%rip), %r16
> 
> $ llvm-objdump -dr got.o
> ...
> 1: d5 48 8b 05 00 00 00 00       movq    (%rip), %r16
> 0000000000000005:  R_X86_64_CODE_4_GOTPCRELX    foo-0x4
> ```

Could you add who is the user for such request:  LLVM + APX + old BFD linker?
The code looks like a dirty workaround. I expect a real user.

https://github.com/llvm/llvm-project/pull/136660
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to