[git commit] Revert "Makerules: respect HARDWIRED_ABSPATH in interp.c"

Mike Frysinger vapier at gentoo.org
Tue May 22 02:22:26 UTC 2012


commit: http://git.uclibc.org/uClibc/commit/?id=e1e7aca536c969f84a2c9fc47f57aa636c763313
branch: http://git.uclibc.org/uClibc/commit/?id=refs/heads/master

This reverts commit 5dffed7dd1a413f3965af702fa7ecd79809d1988.

This breaks ldd when HARDWIRED_ABSPATH=n.

[1] http://lists.uclibc.org/pipermail/uclibc/2011-March/045048.html

From: Timo Teräs <timo.teras at iki.fi>
Your commit 5dffed7dd1a413f3965af702fa7ecd79809d1988 removed absolute
path from the interpreter binary name embedded in ELF files.

This makes ldd seg.fault as it seems to assume absolute paths.

gdb sayeth:

(gdb) where
 #0  0x00111ae3 in find_elf_interpreter (ehdr=0xb7a74000) at
../utils/ldd.c:556
 #1  0x00111f2a in find_dependencies (filename=0x114910
"/home/fabled/aports/main/libc0.9.32/src/uClibc-0.9.32-rc3/lib/librt.so.0.9.32")
at ../utils/ldd.c:676
 #2  0x0011228e in main (argc=1, argv=0xbffff6e8) at ../utils/ldd.c:777
(gdb) p tmp
tmp = NULL
(gdb) p interp_dir
$1 = 0x116660 "ld-uClibc.so.0.9.32"

[2] http://lists.uclibc.org/pipermail/uclibc/2011-March/045054.html

From: Mike Frysinger <vapier at gentoo.org>
On Wed, Mar 23, 2011 at 7:18 AM, Peter Mazinger wrote:
>> Your commit 5dffed7dd1a413f3965af702fa7ecd79809d1988 removed absolute
>> path from the interpreter binary name embedded in ELF files.
>
> do you consider my patch wrong?

yes.  the absolute path to the ldso must be encoded in binaries.  the
point of HARDWIRED_ABSPATH is purely for sysroot/non-sysroot
toolchain, and the interp path isnt involved with that.

are you sure this even works at runtime ?  i'm pretty sure the kernel
doesnt do any path lookups on the interp string.

Signed-off-by: Sedat Dilek <sedat.dilek at gmail.com>
Signed-off-by: Mike Frysinger <vapier at gentoo.org>
---
 Makerules |    6 ------
 1 files changed, 0 insertions(+), 6 deletions(-)

diff --git a/Makerules b/Makerules
index a215334..44a4e39 100644
--- a/Makerules
+++ b/Makerules
@@ -377,14 +377,8 @@ $(top_builddir)%.dep:
 $(top_builddir)lib/interp.c: | $(top_builddir)lib
 	$(Q)echo "/* Force shared libraries to know about the correct library loader */" > $@.tmp
 	$(Q)echo "#include <features.h>" >> $@.tmp
-ifeq ($(HARDWIRED_ABSPATH),y)
 	$(Q)echo "const char __dl_ldso__[] attribute_hidden __attribute__ ((weak)) __attribute__ ((section " \
 		"(\".interp\"))) =\""$(RUNTIME_PREFIX)$(MULTILIB_DIR)/$(UCLIBC_LDSO)"\";" >> $@.tmp
-	$(Q)$(SED) -i -e 's://:/:g' $@.tmp
-else
-	$(Q)echo "const char __dl_ldso__[] attribute_hidden __attribute__ ((weak)) __attribute__ ((section " \
-		"(\".interp\"))) =\""$(UCLIBC_LDSO)"\";" >> $@.tmp
-endif
 	$(Q)mv $@.tmp $@
 
 $(interp): $(top_builddir)lib/interp.c | $(sub_headers)


More information about the uClibc-cvs mailing list