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: division in ld scripts


"Jan Beulich" <JBeulich@novell.com> writes:

>>>> Ian Lance Taylor <iant@google.com> 09.09.09 16:48 >>>
>>"Jan Beulich" <JBeulich@novell.com> writes:
>>
>>> Is it known/intended/documented that using the division operator (/) in
>>> ld scripts requires a blank to follow, at least in some cases (see below)?
>>> All other operators seem to behave as expected (apart from the missing
>>> but unlikely to be needed ^), while / results in a "syntax error" failure.
>>
>>The linker language is kind of a mess.  The problem here is that '/' can
>>appear in a file name, so the whole string gets picked up as a file name
>>rather than a number.  I think it would be pretty hard to change without
>>breaking existing scripts.
>
> But why would that "can appear in a file name" argument not also apply
> to the other operators? Especially '-' shouldn't be that uncommon, albeit
> perhaps not at the beginning of a file name.

Yes, the issue is which characters the linker script language will
permit at the start of a file name.  I was wrong in saying that the
whole string gets picked up as a file name.  What gets picked up as a
file name is the part starting with the slash.  The characters which are
permitted at the start of a file name are, from ldlex.l:

FILENAMECHAR1	[_a-zA-Z\/\.\\\$\_\~]

Ian


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