Summary: | csu/libc-start.c should not call ARCH_APPLY_IREL in static pie mode | ||
---|---|---|---|
Product: | glibc | Reporter: | Fangrui Song <i> |
Component: | dynamic-link | Assignee: | Not yet assigned to anyone <unassigned> |
Status: | UNCONFIRMED --- | ||
Severity: | normal | CC: | hjl.tools, Houdek.Ryan |
Priority: | P2 | ||
Version: | unspecified | ||
Target Milestone: | --- | ||
Host: | Target: | ||
Build: | Last reconfirmed: |
Description
Fangrui Song
2021-01-08 17:57:31 UTC
*** Bug 28066 has been marked as a duplicate of this bug. *** Glibc uses DT_XXX to handle relocations, including IFUNC relocations. Since there is no need to relocate static executable and there is no DT_XXX in static executable, I added __rela_iplt_start/__rela_iplt_end to handle IFUNC in static executable which doesn't need relocation. Since DT_XXX is used to handle relocations, including IFUNC relocations, in static PIE, linker shouldn't define __rela_iplt_start/__rela_iplt_end when DT_XXX is created. Please fix the lld bug. I worked around the glibc csu/libc-start.c ARCH_APPLY_IREL issue (unclear semantics) and unneeded diff -u =(ld.bfd --verbose) =(ld.bfd -pie --verbose) difference in ld.lld f8cb78e99aae9aa3f89f7bfe667db2c5b767f21f ([ELF] Don't define __rela_iplt_start for -pie/-shared) (target: LLD 13.0.0) but my complaint remains for glibc: https://sourceware.org/pipermail/libc-alpha/2021-July/128981.html |