[PATCH v3 3/6] Initialize l_mach field from rtld link_map

Jovan Dmitrovic jovan.dmitrovic@htecgroup.com
Wed Sep 3 13:53:31 GMT 2025


From: Aleksandar Rakic <aleksandar.rakic@htecgroup.com>

Based on patch submitted by Sandra Loosemore:
https://sourceware.org/ml/libc-alpha/2015-03/msg00704.html

For MIPS builds, l_mach field contains fpabi value.
If l_mach isn't zero-initialized, we may get dynamic linking
failures due to incompatible FP ABIs. Similar issue may arise
or is already present on other platforms.

Reported-by: Sandra Loosemore <sandra@codesourcery.com>
---
 elf/rtld.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/elf/rtld.c b/elf/rtld.c
index 753ce6690b..10bf816e7f 100644
--- a/elf/rtld.c
+++ b/elf/rtld.c
@@ -532,6 +532,7 @@ _dl_start (void *arg)
      do not have to use the temporary bootstrap_map.  Global variables
      are initialized to zero by default.  */
 #ifndef DONT_USE_BOOTSTRAP_MAP
+  bootstrap_map.l_mach = (struct link_map_machine) {};
 # ifdef HAVE_BUILTIN_MEMSET
   __builtin_memset (bootstrap_map.l_info, '\0', sizeof (bootstrap_map.l_info));
 # else
-- 
2.34.1


More information about the Libc-alpha mailing list