[comp.sys.sun] SunOS 4.1 `ld' bug ...

peterli@mis.ucsf.edu (Peter Li) (11/21/90)

I encountered this interesting `ld' bug in SunOS 4.1 while compiling ET++
using AT&T C++:

1. obtain ET++ release 2.0.
2. set up SUNWINDOW, SUNOS, PROGENV, POSTSCRIPT, PIC, and PICT.
3. do make, it should bomb in making application "app" by reporting 
   "ld: bad secondary magic number" or "ld: missing symbol".

I basically tracked down the problem to the structure of "et.o" in src.
Evidently the "ld -X -r -o et.o ..." constructs an et.o with an extract
symbol entry in the symbol table. The size of of symbol table in the exec
header is the correct length (minus the extra entry), but the entries in
the symbol table are all offset by one.  You can verify this by using
"adb" (if hardcore enough).  What you end up is a horrible mess that you
can't fix by adb, because of the all the symbol tables are off by an entry
displacement.

This seems to happen only in SunOS 4.1 for Sun3 and Sun4 (SS1+, at least),
and not in SunOS 4.0.3.

Is there anyone out there who have success with compiling ET++ on SunOS
4.1 ?  Is this a documented bug with `ld' for SunOS 4.1 ?

Thanks,
Peter Li
email: peterli@mis.ucsf.edu

P.S. I did fix this by using a tool that rebuilds the symbol table after
some adb exploring. Is there a better and more direct solution ?