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: Match archive:file in linker script filespecs


On Fri, Jun 06, 2008 at 03:01:34PM +0930, Alan Modra wrote:
> This extends the linker script input section file specification to
> match files within archives.  I've chosen to enable this only for SPU,
> where we need the feature to conveniently specify sections for
> overlays.  (For instance, libgfortran contains read.o as does
> newlib, and we might have read.o on the command line.)  If people
> think this is a good idea the feature can be enabled on all targets,
> and possibly for other filespecs such as those in EXCLUDE_FILE.
> 
> "archive:file" matches "file" within "archive"
> "archive:"     matches the whole "archive"
> ":file"        matches "file" but not one in an archive
> 
> Either one or both of "archive" and "file" can contain shell wildcards.

Did you consider the archive(file) syntax?  Since that's what we use
in error messages, it makes sense to me to use it in linker scripts
too (and people frequently try to write it that way already).  But I'm
not sure it's unambiguous.

archive: should work fine without the colon; I don't think we need to
concern ourselves overly with libfoo.a containing an ELF ET_REL file
named libbar.a.  Alternatively, libfoo.a(*).  Wildcarding is
useful.

For :file we'd still need a colon, unless you wanted to make the
default be to only match files from the command line - a bad idea
since it would surely break existing scripts.

Oh and, hey, the manual and NEWS... :-)

-- 
Daniel Jacobowitz
CodeSourcery


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