[patch] init_array/fini_array support

John Bowler jbowler at acm.org
Thu Feb 2 08:11:09 UTC 2006


From: Joakim Tjernlund [mailto:joakim.tjernlund at transmode.se]
>if (__builtin_expect (GLRO(dl_dynamic_weak), 0))
>This is only true if you set env. var. LD_DYNAMIC_WEAK=1
>
>You can change the weak behaviour dynamically, but the default
>is NOT to prefer a strong definition over a weak.

In dl-support.c:

_dl_dynamic_weak = *(getenv ("LD_DYNAMIC_WEAK") ?: "") == '\0'

If I read that correctly (I'm not familiar with all these GNU
modifications to C...) if LD_DYNAMIC_WEAK is not set, or is set
to the empty string, _dl_dynamic_weak is true, otherwise (if it
is set to any non-empty string) it is false.  The code above
matches the test on LD_BIND_NOW and that test sets '_dl_lazy' -
so this seems right (_dl_lazy is true if LD_BIND_NOW is not set,
_dl_dynamic_weak is true if LD_DYNAMIC_WEAK is not set).

GLRO(x) is just _##x

Now I admit that '__builtin_expect(value, 0)' implies that the
writer of the 'if' expected the value to normally be zero, so maybe
I'm misunderstanding the setting of _dl_dynamic_weak.

John Bowler <jbowler at acm.org>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: winmail.dat
Type: application/ms-tnef
Size: 2192 bytes
Desc: not available
Url : http://lists.busybox.net/pipermail/uclibc/attachments/20060202/579ff810/attachment.bin 


More information about the uClibc mailing list