This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
Re: linker file/section matching rules when using libraries
- From: Ian Lance Taylor <ian at wasabisystems dot com>
- To: "Nick Kelsey" <fsf at silicondust dot com>
- Cc: <binutils at sources dot redhat dot com>
- Date: 04 Feb 2004 15:06:03 -0500
- Subject: Re: linker file/section matching rules when using libraries
- References: <065101c3eb57$b756ff80$0502a8c0@scenix.com>
"Nick Kelsey" <fsf@silicondust.com> writes:
> In the linker script, when writing section matching rules they follow the
> following form:
>
> <filename> (<section name>)
>
> For example:
> * (.text)
> * (.text.*)
>
> The filename works if you specify the name of a .o file and either pass it
> on the command line or the .o file is available in the linker .o search
> path.
>
> The problem is that our build process puts everything into lib files (.a)
> and the .o files are not available to the linker.
>
> How do you specify either a lib file to match or ideally a file within a lib
> file (if that is possible)?
You can't pick a file out of an archive in a linker script.
If you name an archive, the mapping will be applied to every object in
the archive. At least, that is how it is supposed to work.
Ian