Subject: toolchain/22098: RPATH not added to /sbin and /bin programs
To: None <gnats-bugs@gnats.netbsd.org>
From: Richard Earnshaw <rearnsha@buzzard.freeserve.co.uk>
List: netbsd-bugs
Date: 07/09/2003 01:09:11
>Number:         22098
>Category:       toolchain
>Synopsis:       RPATH not added to /sbin/ and /bin programs
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    toolchain-manager
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Wed Jul 09 00:36:00 UTC 2003
>Closed-Date:
>Last-Modified:
>Originator:     Richard Earnshaw
>Release:        NetBSD 1.6U
>Organization:
ARM
	
>Environment:
	
	
System: NetBSD buzzard.buzzard.freeserve.co.uk 1.6U NetBSD 1.6U (RPC_WSCONS) #0: Tue Jul 8 01:18:39 BST 2003 rearnsha@osprey.buzzard.freeserve.co.uk:/work/build/acorn32/src/sys/arch/acorn32/compile/RPC_WSCONS acorn32
Architecture: arm
Machine: acorn32
>Description:
	executables in /bin and /sbin are missing an RPATH entry, so will not 
	run at boot unless /lib is in /etc/ld.so.conf

	From current:
	objdump -x /sbin/init

	/sbin/init:     file format elf32-littlearm
	/sbin/init
	architecture: arm, flags 0x00000112:
	EXEC_P, HAS_SYMS, D_PAGED
	start address 0x00009378
	...
	  NEEDED      libutil.so.7
	  NEEDED      libcrypt.so.0
	  NEEDED      libc.so.12
	  INIT        0x8f10
	  FINI        0xb6cc

	On an older version of current (circa 1.6T), we get

	/sbin/init:     file format elf32-littlearm
	/sbin/init
	architecture: arm, flags 0x00000112:
	EXEC_P, HAS_SYMS, D_PAGED
	start address 0x000095f0
	...
	Dynamic Section:
	  NEEDED      libutil.so.7
	  NEEDED      libcrypt.so.0
	  NEEDED      libc.so.12
	  RPATH       /lib:/usr/lib
	  INIT        0x9128
	  FINI        0xbb2c

	Note the RPATH entry which allows init to find its shared libraries
	even when /usr/lib is not mounted.

	
>How-To-Repeat:
	Build and install current, ensure /lib is not in ld.so.conf, then
	reboot.
	
>Fix:
	Not sure.  A work-around is to add /lib to ld.so.conf.
	
>Release-Note:
>Audit-Trail:
>Unformatted:
 	current as of July 5th