This is the mail archive of the
mailing list for the binutils project.
Re: PATCH: Add STB_SECONDARY support
On Tue, Jul 3, 2012 at 1:25 AM, Alan Modra <email@example.com> wrote:
> On Mon, Jul 02, 2012 at 06:31:34AM -0700, H.J. Lu wrote:
>> The main usage is
>> 1. ISV defines a secondary symbol in a library.
>> 2. The library with a secondary symbol is used by programmers.
>> #1 and #2 are different people. ISV has no control over
>> the command line used by programmers. ?We need
>> a reliable solution which is transparent to programmers,
> It sounds to me that the best solution would be to define a way of
> marking an archive that instructs the linker to link it last
> regardless of where it is placed on the command line, then just use
> weak symbols. ?This has the added benefit that your backup
> implementations will be included on an object file granularity, which
> is likely to be the simplest and most useful model. ?Also, this should
> work with PE and other object formats rather than being ELF only.
> Options for marking the archive are
> - A new magic string to replace "!<arch>\012", as we did for thin
> ? archives.
> - A special file name in the archive, similar to the way extended file
> ? names are recognized.
> - A magic symbol in the armap.
> I'm not sure which is best.
This is not transparent to programmers. Programmers shouldn't
need to make any changes to their build environment other than
installing a new binutils.