]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
rtld: Move call_init_paths after _dl_process_pt_gnu_property
authorAdhemerval Zanella <adhemerval.zanella@linaro.org>
Fri, 6 Dec 2024 17:37:52 +0000 (14:37 -0300)
committerAdhemerval Zanella <adhemerval.zanella@linaro.org>
Thu, 6 Mar 2025 13:13:46 +0000 (10:13 -0300)
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

index 727e16f2337449d66302aca3ecb3dc93b5f82250..c51670143dddacaf609b3b3b5c9ffebe19c13c95 100644 (file)
@@ -1681,10 +1681,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);
@@ -1740,6 +1736,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);