diff options
| author | Jessica Clarke <jrtc27@FreeBSD.org> | 2026-02-08 16:35:01 +0000 |
|---|---|---|
| committer | Jessica Clarke <jrtc27@FreeBSD.org> | 2026-02-08 16:39:44 +0000 |
| commit | 5beaa1ee7595ce4a09ac4827ec3e3e2aa13a9f67 (patch) | |
| tree | 017f6241c503dddff5a5fa80c9aa60064065c307 | |
| parent | afe666a8db82c42fe0b8d55d3142c9d305d1bc28 (diff) | |
Revert "Additional icache paranoia: non-PLT relocations can modify the text segment."
reloc_nonplt_object, and thus reloc_non_plt, only ever handles data
relocations, so this paranoia is completely unfounded and only has the
effect of significantly slowing down program startup for binaries with
large amounts of code, like Clang.
If this breaks any systems, that would likely be due to insufficient
flushing in the pmap implementation for executable mappings, as this
existing rtld behaviour would mask any such bugs.
This reverts commit 4b51c69976fd84e93ec7695858375c8150c4fe61.
Reviewed by: adrian
Differential Revision: https://reviews.freebsd.org/D54221
| -rw-r--r-- | libexec/rtld-elf/powerpc/reloc.c | 13 | ||||
| -rw-r--r-- | libexec/rtld-elf/powerpc64/reloc.c | 13 |
2 files changed, 0 insertions, 26 deletions
diff --git a/libexec/rtld-elf/powerpc/reloc.c b/libexec/rtld-elf/powerpc/reloc.c index eb6f50c3c841..ea87088a7fbd 100644 --- a/libexec/rtld-elf/powerpc/reloc.c +++ b/libexec/rtld-elf/powerpc/reloc.c @@ -332,7 +332,6 @@ reloc_non_plt(Obj_Entry *obj, Obj_Entry *obj_rtld, int flags, { const Elf_Rela *relalim; const Elf_Rela *rela; - const Elf_Phdr *phdr; SymCache *cache; int r = -1; @@ -361,18 +360,6 @@ reloc_non_plt(Obj_Entry *obj, Obj_Entry *obj_rtld, int flags, done: if (cache != NULL) free(cache); - - /* - * Synchronize icache for executable segments in case we made - * any changes. - */ - for (phdr = obj->phdr; phdr < obj->phdr + obj->phnum; phdr++) { - if (phdr->p_type == PT_LOAD && (phdr->p_flags & PF_X) != 0) { - __syncicache(obj->relocbase + phdr->p_vaddr, - phdr->p_memsz); - } - } - return (r); } diff --git a/libexec/rtld-elf/powerpc64/reloc.c b/libexec/rtld-elf/powerpc64/reloc.c index a107da6b0a6a..bdc56f345678 100644 --- a/libexec/rtld-elf/powerpc64/reloc.c +++ b/libexec/rtld-elf/powerpc64/reloc.c @@ -327,7 +327,6 @@ reloc_non_plt(Obj_Entry *obj, Obj_Entry *obj_rtld, int flags, { const Elf_Rela *relalim; const Elf_Rela *rela; - const Elf_Phdr *phdr; SymCache *cache; int bytes = obj->dynsymcount * sizeof(SymCache); int r = -1; @@ -359,18 +358,6 @@ reloc_non_plt(Obj_Entry *obj, Obj_Entry *obj_rtld, int flags, done: if (cache) munmap(cache, bytes); - - /* - * Synchronize icache for executable segments in case we made - * any changes. - */ - for (phdr = obj->phdr; phdr < obj->phdr + obj->phnum; phdr++) { - if (phdr->p_type == PT_LOAD && (phdr->p_flags & PF_X) != 0) { - __syncicache(obj->relocbase + phdr->p_vaddr, - phdr->p_memsz); - } - } - return (r); } |
