[PATCH v8 4/8] rtld: Move call_init_paths after _dl_process_pt_gnu_property
Adhemerval Zanella
adhemerval.zanella@linaro.org
Wed Jan 29 17:22:38 GMT 2025
To allow the loader malloc behavior to be changed by the gnu attribute.
It would allow the pages allocated to be memory sealed if the loader
if built with memory sealing.
Checked on x86_64-linux-gnu.
---
elf/rtld.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/elf/rtld.c b/elf/rtld.c
index b1ae901053..4ab285abce 100644
--- a/elf/rtld.c
+++ b/elf/rtld.c
@@ -1688,10 +1688,6 @@ dl_main (const ElfW(Phdr) *phdr,
/* With vDSO setup we can initialize the function pointers. */
setup_vdso_pointers ();
- /* Initialize the data structures for the search paths for shared
- objects. */
- call_init_paths (&state);
-
/* Initialize _r_debug_extended. */
struct r_debug *r = _dl_debug_initialize (_dl_rtld_map.l_addr,
LM_ID_BASE);
@@ -1747,6 +1743,10 @@ dl_main (const ElfW(Phdr) *phdr,
/* Assign a module ID. Do this before loading any audit modules. */
_dl_assign_tls_modid (&_dl_rtld_map);
+ /* Initialize the data structures for the search paths for shared
+ objects. */
+ call_init_paths (&state);
+
audit_list_add_dynamic_tag (&state.audit_list, main_map, DT_AUDIT);
audit_list_add_dynamic_tag (&state.audit_list, main_map, DT_DEPAUDIT);
--
2.43.0
More information about the Libc-alpha
mailing list