We need to make sure not to emit R_X86_64_GOTPCRELX relocations for instructions that use a REX prefix. If a REX prefix is present, we need to instead use a R_X86_64_REX_GOTPCRELX relocation. The existing logic for CALL64m, JMP64m, etc. already handles this by checking the HasREX parameter and using it to determine which relocation type to use. Do this for all instructions that can use relaxed relocations.
Details
Details
Diff Detail
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
llvm/test/MC/X86/gotpcrelx.s | ||
---|---|---|
125 | LG. May I bother you to delete ELF/got-relaxed-rex.s and add its test coverage into this file as well? |
Comment Actions
Merge ELF/got-relaxed-rex.s into X86/gotpcrelx.s, update lld/test/ELF/x86-64-gotpc-relax-nopic.s.
Comment Actions
LGTM.
llvm/test/MC/X86/gotpcrelx.s | ||
---|---|---|
17 | Consider moving add R_X86_64_REX_GOTPCRELX instructions below R_X86_64_REX_GOTPCRELX ones. |
llvm/test/MC/X86/gotpcrelx.s | ||
---|---|---|
17 | I'm assuming you meant below R_X86_64_GOTPCRELX :) Sure, pushed with that change. |
Consider moving add R_X86_64_REX_GOTPCRELX instructions below R_X86_64_REX_GOTPCRELX ones.