This is the mail archive of the binutils@sourceware.org mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: ar: POSIX way of creating static library containing similarly named objects


>> Can `ar' be used to create a static library comprised of the objects
>> above without either of which replacing any symbols? In other words, both
>> namespace_foo/state.o and namespace_bar/state.o are put into the same
>> library but no symbols are replaced.
>
> Use the 'q' option rather than the 'r' option when adding the object files
> to the library - and create the symbol index after adding the objects,
> rather than at the same time.  Ie:

If you don't need the archive to be self-contained, you can also use a
thin archive:

$ ar crT libstate.a src/namespace*/state.o
$ ar t libstate.a
src/namespace_bar/state.o
src/namespace_foo/state.o

Here, libstate.a contains just the symbol table, with references to
the object files in their separate directories.

-cary


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]