[patch] fix uninitialized variable in dynamic linker

Sandra Loosemore sandra@codesourcery.com
Sat Mar 21 21:48:00 GMT 2015


When we were testing glibc 2.21 here, we were getting some mysterious 
dynamic linking failures on MIPS due to the recent-ish changes for that 
target to ignore objects with incompatible FP ABIs.  On further 
investigation, it turned out that the dynamic linker's own entry in the 
link map had an invalid l_mach.fpabi value.  I tracked this down to 
failure to initialize that field in the stack-allocated bootstrap_map 
structure in _dl_start; _dl_start_final was then happily copying the 
uninitialized l_mach value into the real map data structure.

The attached patch zero-initializes the entire bootstrap_map data 
structure.  I thought this was better than selectively initializing 
specific fields since it future-proofs the code against similar errors 
involving other fields that might be added (or used) in the future.

I've verified that this fixes the 2.21 MIPS problems we saw.  Is this 
patch OK for mainline head, or is further testing required?

-Sandra

-------------- next part --------------
A non-text attachment was scrubbed...
Name: rtld.log
Type: text/x-log
Size: 137 bytes
Desc: not available
URL: <http://sourceware.org/pipermail/libc-alpha/attachments/20150321/2da9c955/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: rtld.patch
Type: text/x-patch
Size: 1407 bytes
Desc: not available
URL: <http://sourceware.org/pipermail/libc-alpha/attachments/20150321/2da9c955/attachment-0001.bin>


More information about the Libc-alpha mailing list