[clang] [lld] [llvm] [X86] Implement disabling APX relocations and EPGR/NDD instrs for relocations (PR #136660)
Shengchen Kan via llvm-commits
llvm-commits at lists.llvm.org
Tue Apr 22 19:52:57 PDT 2025
KanRobert wrote:
> > > Introduce an option (-mapx-relax-relocations) to control the emission of the new APX relocations. It's off by default to keep backward compatibility with old version of ld and other linkers without APX support. And EGPR and NDD are also suppressed to avoid the instructions updated incorrectly by old version of linkers.
> >
> >
> > Not understand this. IIUC, either we should not emit APX instructions at all, which is controlled by `-m[no-]apxf`, or we should not relax the all the relocations, which is controlled by `-Wl,--no-relax`.
>
> If the APX relocation types are emitted in MC, they cannot be recognized by old version of linkers. It leads to APX features unavailable on existing Linux OSes with old version of linkers. `--no-relax` just disables the GOT optimization in linker, and it cannot resolve the link error of unsupported relocation type as mentioned above.
But if you just old relocations for APX instructions and `no-relax` is not used. Wouldn't the old linker do the relaxation incorrectly and silently?
https://github.com/llvm/llvm-project/pull/136660
More information about the llvm-commits
mailing list