One issue during kernel porting on coldfire m5441x: dl_main: Assertion `_rtld_local._dl_rtld_map.l_libname' failed!
Hi,
I met one interesting issue during I porting 2.6.29 kernel on ColdFire paltform (v4 core, mcf5441x).
I could boot up the kernel with initramfs, but the kernel message below displays some error information,
which line I colored red. initramfs image only includes busybox static binary.
*starting pid 371, tty '': '/etc/rc.d/rcS'
Mounting /proc and /sys
Starting the hotplug events dispatcher udevd
Inconsistency detected by ld.so: rtld.c: 1215: dl_main: Assertion `_rtld_local._dl_rtld_map.l_libname' failed!
Synthesizing initial hotplug events
Inconsistency detected by ld.so: rtld.c: 1215: dl_main: Assertion `_rtld_local._dl_rtld_map.l_libname' failed!
Inconsistency detected by ld.so: rtld.c: 1215: dl_main: Assertion `_rtld_local._dl_rtld_map.l_libname' failed!
Setting the hostname to freescale
Mounting filesystems
mount: mounting usbfs on /proc/bus/usb failed: No such file or directory Starting syslogd and klogd
Running sysctl
Setting up networking on loopback device:
Setting up networking on eth0:
Adding static route for default gateway to 10.192.208.254:
route: SIOCADDRT: File exists
Setting nameserver to 10.192.208.1 in /etc/resolv.conf:
Starting inetd:
starting pid 434, tty '': '-/bin/sh'*
This error message shows that I can't load dynamical binary: if I build initramfs with busybox dynamical binary,
it's can't boot up and just prints above error information.
Anybody met the issue like-same? Some suggestion is appreciated.
Signature · 2 lines
Best Regards, Lanttor
A message that is not in the archive (sent off-list or not yet received): [email protected]
Hi, Max
Thanks for your information.
Quoted 2 lines
It is quite strange that the run-time linker is invoked for a statically linked busybox -- maybe this is the problem?
This is not the problem, because I setup udevd daemon before busybox when boot up. when I disable udevd and use static dev files, there will no error information.
That means staitic binary is OK to run, but if I run dynamic binary, it's failed and prints log: Inconsistency detected by ld.so: rtld.c:
1215: dl_main: Assertion `_rtld_local._dl_rtld_map.l_libname' failed!
Quoted 2 lines
I suggest you take a look at <glibc_src>/elf/rtld.c and trace how the control gets there.
I use glibc-2.5 and check elf/rtld.c 1215 line, the code is as follows:
1206 if (! GL(dl_rtld_map).l_libname && GL(dl_rtld_map).l_name)
1207 {
1208 /* We were invoked directly, so the program might not have a
1209 PT_INTERP. */
1210 _dl_rtld_libname.name = GL(dl_rtld_map).l_name; 1211 /* _dl_rtld_libname.next = NULL; Already zero. */ 1212 GL(dl_rtld_map).l_libname = &_dl_rtld_libname;
1213 }
1214 else
1215 assert (GL(dl_rtld_map).l_libname); /* How else did we get
here? */
So I guess GL(dl_rtld_map).l_libname is not NUL and throws an exception. The reason is still tracing...
Best Regards,
Lanttor
------------------------------------------------------------------------
*From:* Maxim Kuvyrkov <[email protected]>
*Sent:* 02/21/2010 10:57:00 PM +0800
*To:* Lanttor <[email protected]>
*CC:* Greg Ungerer <[email protected]>, [email protected] *Subject:* One issue during kernel porting on coldfire m5441x: dl_main:
Assertion `_rtld_local._dl_rtld_map.l_libname' failed!
Quoted 24 lines · Lanttor
Quoted 9 lines
Hi,
I met one interesting issue during I porting 2.6.29 kernel on ColdFire paltform (v4 core, mcf5441x).
I could boot up the kernel with initramfs, but the kernel message below displays some error information,
which line I colored red. initramfs image only includes busybox static binary....
Quoted 4 lines
Inconsistency detected by ld.so:
rtld.c: 1215:dl_main: Assertion_rtld_local._dl_rtld_map.l_libname' failed! Inconsistency detected by ld.so: rtld.c: 1215: dl_main: Assertion_rtld_local._dl_rtld_map.l_libname' failed!The error is an assertion failure in GLIBC's runtime linker, it is not a kernel issue. It is quite strange that the run-time linker is invoked for a statically linked busybox -- maybe this is the problem? I suggest you take a look at <glibc_src>/elf/rtld.c and trace how the control gets there.
Regards,
Quoted 7 lines · Lanttor
1206 if (! GL(dl_rtld_map).l_libname && GL(dl_rtld_map).l_name)
1207 {
1208 /* We were invoked directly, so the program might not have a
1209PT_INTERP. */1210 _dl_rtld_libname.name = GL(dl_rtld_map).l_name; 1211 /* _dl_rtld_libname.next = NULL; Already zero. */ 1212 GL(dl_rtld_map).l_libname = &_dl_rtld_libname;
Quoted 8 lines
1213 }
1214 else
1215 assert (GL(dl_rtld_map).l_libname); /* How else did we get
here? */So I guess GL(dl_rtld_map).l_libname is not NUL and throws an exception. The reason is still tracing...
The assertion fails only if both l_libname and l_name are NULL.
Andreas.
Signature · 3 lines
Andreas Schwab, [email protected] GPG Key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5 "And now for something completely different."
Quoted 2 lines
The assertion fails only if both
l_libnameandl_nameare NULL.
Thanks Andreas, you're right.
Now I have resolved this issue: I need set the value to %rambar1 register in the head.S file.
This register is the configure register for SRAM. Although I not use SRAM memory, but it
seems I need configure this register, otherwise I will meet the issue before.
I'm not sure why this fix will affect run time loader. I guess the toolchain may do some registers' check.
Best Regards,
Lanttor
------------------------------------------------------------------------
*From:* Andreas Schwab <[email protected]>
*Sent:* 02/23/2010 3:23:28 AM +0800
*To:* Lanttor <[email protected]>
*CC:* Maxim Kuvyrkov <[email protected]>, Greg Ungerer <[email protected]>, [email protected]
*Subject:* One issue during kernel porting on coldfire m5441x: dl_main:
Assertion `_rtld_local._dl_rtld_map.l_libname' failed!
Quoted 25 lines
Quoted 7 lines · Lanttor
1206 if (! GL(dl_rtld_map).l_libname && GL(dl_rtld_map).l_name)
1207 {
1208 /* We were invoked directly, so the program might not have a
1209PT_INTERP. */1210 _dl_rtld_libname.name = GL(dl_rtld_map).l_name; 1211 /* _dl_rtld_libname.next = NULL; Already zero. */ 1212 GL(dl_rtld_map).l_libname = &_dl_rtld_libname;Quoted 9 lines
1213 }
1214 else
1215 assert (GL(dl_rtld_map).l_libname); /* How else did we get
here? */So I guess GL(dl_rtld_map).l_libname is not NUL and throws an exception. The reason is still tracing...
The assertion fails only if both
l_libnameandl_nameare NULL.Andreas.