Bug 1543 - Statically linked ldconfig dies with call to null
Summary: Statically linked ldconfig dies with call to null
Status: RESOLVED FIXED
Alias: None
Product: uClibc
Classification: Unclassified
Component: Shared Library Support (show other bugs)
Version: 0.9.31
Hardware: PC Linux
: P5 normal
Target Milestone: ---
Assignee: unassigned
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-04-14 00:22 UTC by Anthony Basile
Modified: 2012-04-17 21:33 UTC (History)
1 user (show)

See Also:
Host: i386-gentoo-linux-uclibc
Target: i386-gentoo-linux-uclibc
Build:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Anthony Basile 2010-04-14 00:22:43 UTC
When building a chroot based on uclibc-0.9.31 on a gentoo system, I found that ldconfig dies with a call to null when UCLIBC_STATIC_LDCONFIG=y is set.  An objdump -S /sbin/ldconfig gives

 0804e965 <__uClibc_main>:
 804e965:	55                   	push   %ebp
 804e966:	57                   	push   %edi
 804e967:	56                   	push   %esi
 804e968:	53                   	push   %ebx
...
 804eb22:	e8 e5 bd ff ff       	call   804a90c <__GI___errno_location>
 804eb27:	c7 00 00 00 00 00    	movl   $0x0,(%eax)
 804eb2d:	e8 ce 14 fb f7       	call   0 <_init-0x80480b4>
 804eb32:	c7 00 00 00 00 00    	movl   $0x0,(%eax)
 804eb38:	55                   	push   %ebp
 804eb39:	8b 83 b0 ff ff ff    	mov    -0x50(%ebx),%eax
 804eb3f:	ff 30                	pushl  (%eax)
...

I was using binutils-2.18 and i386-gentoo-linux-uclibc-4.4.3.  Vanilla gentoo.
Comment 1 Peter Korsgaard 2010-07-06 11:43:01 UTC
That seems to be GCC PR32219 hitting with __h_errno_location. Could you try applying aa67771881d65373da448ad5f7a8393f3a1d9469 and see if it still happens?
Comment 2 Bernhard Reutner-Fischer 2012-04-17 21:33:00 UTC
This was obfuscated in uClibc in aa67771881d65373da448ad5f7a8393f3a1d9469 and works properly now with 4.7.x