arla 0.20: getcwd & XFS panics

Brandon S. Allbery KF8NH allbery at kf8nh.apk.net
Sat Dec 26 01:13:32 CET 1998


In message <5lbtkrer27.fsf at assaris.sics.se>, assar at stacken.kth.se writes:
+-----
| Max <maxk at chinook.stanford.edu> writes:
| > Until I did that, I couldn't start X (it complained about a missing
| > __getcwd symbol).
| 
| According to my understanding, this means there's some program that's
| linked against libc5 (which doesn't have a __getcwd).
+--->8

Yes, very likely.  Although I thought Debian was fully libc6.

| What has changed is that getcwd.so tries to fallback on calling
| __getcwd if it doesn't find a getcwd system call.  This fails with
| libc5 becaus it doesn't have a __getcwd symbol.  I've tried to make a
| solution that works with libc5 but failed.
+--->8

Obtain the libc5 source, pull out getcwd.c, then modify it so getcwd is 
declared as ___getcwd and __getcwd is a weak symbol (similar to libc6).

	int
	___getcwd (/* ... */)
	{
		/* ... */
	}

	int __getcwd (/* ... */) __attribute__ (weak, alias ("___getcwd"));

Compile this against libc5 to produce a shared object, which is then added 
to /etc/ld.so.preload.  Now libc6 programs will use the non-weak __getcwd in 
/lib/libc.so.6, while libc5 programs will follow the weak symbol to 
___getcwd because there is no non-weak __getcwd.

-- 
brandon s. allbery	[os/2][linux][solaris][japh]	 allbery at kf8nh.apk.net
system administrator	     [WAY too many hats]	   allbery at ece.cmu.edu
carnegie mellon / electrical and computer engineering			 KF8NH
     We are Linux. Resistance is an indication that you missed the point.







More information about the Arla-drinkers mailing list