From e1e7aca536c969f84a2c9fc47f57aa636c763313 Mon Sep 17 00:00:00 2001 From: Sedat Dilek Date: Thu, 17 May 2012 15:18:29 +0200 Subject: Revert "Makerules: respect HARDWIRED_ABSPATH in interp.c" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 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 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 Signed-off-by: Mike Frysinger --- Makerules | 6 ------ 1 file changed, 6 deletions(-) diff --git a/Makerules b/Makerules index a215334ef..44a4e39cd 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 " >> $@.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) -- cgit v1.2.3