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 Sat, Jun 07, 2008 at 12:08:31AM +0930, Alan Modra wrote:
> On Fri, Jun 06, 2008 at 08:13:19AM -0400, Daniel Jacobowitz wrote:
> > On Fri, Jun 06, 2008 at 03:01:34PM +0930, Alan Modra wrote:
> > > "archive:file" matches "file" within "archive"
> > > "archive:"     matches the whole "archive"
> > > ":file"        matches "file" but not one in an archive
> > 
> > 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.
> 
> I did think about using this but rejected the idea for a few reasons.
> The main one you mention.  It is ambiguous.  See ldgram.y
> input_section_spec_no_keep, which allows a filespec without the
> '(' sectionlist ')' part to mean all sections in the file.  So is that
> achive(file) or file(section)?

Right.  Pity that won't work out - I'd suggest switching the messages
for consistency but that's an awful idea (and work).  So colons it is!

> Of course, one thing against the syntax I chose is that it breaks any
> existing scripts that happen to select for a file containing a colon.
> I think (and hope) that this is unlikely, except possibily in the case
> of dos filesystem "c:" and suchlike which I already handle.

Do we have any wildcarding so that people can write
"libfoo.a:strange?filename.o" for strange:filename.o?

-- 
Daniel Jacobowitz
CodeSourcery


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