Subject: Problems with ld and libraries with file names > 16 chars
To: None <>
From: John C. Hayward <>
List: current-users
Date: 01/04/1994 22:05:52
Dear NetBSD'ers,
   I have discovered that ld gives a bad magic number error if you have
a file in a library which is over 16 characters in lenght.  I know this
problem is in NetBSD-09 and believe it is also in NetBSD-Current (grabbed
the sources hack it so it would compile on a 09 system and gave the same
error).  I have fixed my version of ld.  I think nm and ranlib may need some
adjusting as well,  it appears that ar does the right thing.
   The problem is that the header of the file stored in ar has a fixed size 
space for the file name (16 bytes).  If the file name is > 16 bytes the 09 
version of ar stores #1/xx where xx is the size of the file name and puts the 
file name right after the header before the code from that file.  Ld does not 
know about this convention and starts reading the file name as the code and 
then complains about a bad magic number.  It reports this on the 
file name (#1).  The problem is in the procedure "decode_library_subfile".

   I have not installed NetBSD-Current because it looked like things are
pretty unstable.  How do I get my changes into NetBSD-Current?