Subject: Re: ar
To: None <tv@pobox.com>
From: ITOH Yasufumi <itohy@netbsd.org>
List: tech-toolchain
Date: 12/14/1999 12:39:58
In article <Pine.NEB.4.21.9912131025490.246-100000@shark.int.duh.org>
tv@pobox.com writes:

> On Mon, 13 Dec 1999, ITOH Yasufumi wrote:
> 
> :  1. ar produces Berkeley file format
> :  2. ar produces SysV ("/" at the end of file names) file format
> 
> System V filenames have many other differences.  However, the binutils based
> ar(1) is supposed to produce System V compliant archives on ELF systems.  
> It does, on alpha, so this is likely an arch-specific bug (i386, sparc?).
> 
> (In fact, binutils ar(1) originally could not produce 4.4BSD archives, only
> "truncated" V7 archives.  I wrote the code for 4.4BSD writing support.)

Oh, I misunderstood.

	% ar cq foo.a aout.o

produces Berkeley format archive and "__.SYMDEF" table;

	% ar cq bar.a elf.o

produces SysV format archive and "/" table.  Right?

However,
	i386% /usr/bin/ar cq foo6.a m68kaout.o
	i386% /usr/bin/ar cq bar6.a m68kelf.o

and (here, no symbol table in foo6.a or bar6.a)

	i386% ranlib-aout.m68k foo6.a
	i386% ranlib-elf.m68k bar6.a

then both of "foo6.a" and "bar6.a" is in Berkeley format and have
"__.SYMDEF" symbol tables (my confusion is from here).  Then again

	i386% ranlib-elf.m68k bar6.a

creates SysV format and "/" table.
What about this?


By the way,
	% rm foo.a
	% ar cq foo.a elf.o aout.o
creates weird archive, the member elf.o is in SysV format and aout.o
is in that of Berkeley's.  Then,
	% ranlib foo.a
makes the aout.o member to SysV format.  Then,
	% ar d foo.a elf.o
makes a SysV random archive which contains a.out member(s) only.

Besides,
	% rm foo.a
	% ar cq foo.a elf.o aout.o
	% ar d foo.a elf.o
creates a Berkeley format archive with "/" table. :-)

I'm rather doubtful about the quality of binutils. :-)
--
ITOH, Yasufumi <itohy@netbsd.org>