Message ID | 20220205172446.652011-1-hjl.tools@gmail.com |
---|---|
Headers | show |
Series | Support DT_RELR relative relocation format | expand |
On Sat, 5 Feb 2022, H.J. Lu via Libc-alpha wrote: > DT_RELR is enabled in glibc shared libraries and position independent > executables (PIE) automatically if linker supports -z pack-relative-relocs > nd the architecture defines SUPPORT_DT_RELR in config.h. At the moment, > only x86 targets define SUPPORT_DT_RELR. I still don't think the SUPPORT_DT_RELR part of this is appropriate. If the linker is reporting -z pack-relative-relocs support on architectures where it won't work, that should be fixed in the linker. (Ideally the DT_RELR implementation in the linker would need as little architecture-specific code as possible, but I realise the BFD ELF linker isn't really designed to minimise code duplication betweeen different architectures.) So just checking for linker support should be sufficient, without a separate hardcoding in glibc of which architectures have such support. (If there are particular binutils releases that claim support but where it's actually broken on some architectures, a more specific configure test would be preferable to hardcoded architecture-specific handling in glibc.)