[lld] r202111 - [LinkerScript] OUTPUT_FORMAT: Parse Quoted Strings

Shankar Easwaran shankare at codeaurora.org
Mon Feb 24 23:49:57 PST 2014


On 2/25/2014 1:38 AM, Rui Ueyama wrote:
> On Mon, Feb 24, 2014 at 11:24 PM, Shankar Easwaran
> <shankare at codeaurora.org>wrote:
>
>> On 2/25/2014 1:14 AM, Rui Ueyama wrote:
>>
>>> On Mon, Feb 24, 2014 at 10:52 PM, Shankar Easwaran
>>> <shankare at codeaurora.org>wrote:
>>>
>>>   Hi Chandler, Rui,
>>>> For example :-
>>>>
>>>> OUTPUT_FORMAT(x, "y", "z")
>>>>
>>>> We need to display an error for the above case, while
>>>>
>>>> OUTPUT_FORMAT("x", "y", "z") produces no error.
>>>>
>>>>   Both gave me error...
>> I am not sure about your ld version, but here it is :-
>>
>> $cat x
>> OUTPUT_FORMAT(x, "y", "z");
>>
>> $ld -T x
>> ld:x:1: syntax error
>> $cat y
>> OUTPUT_FORMAT("x", "y", "z");
>> $ld -T y
>> ld: no input files
>
> OUTPUT_FORMAT( x , "y", "z");
>
> does not print an error (x with surrounding whitespaces). It's not a matter
> of double quotes? I found that some parentheses in Linux's libc.so are
> surrounded by whitespace characters too, so something may be wrong with "("
> handling in GNU LD, but it seems to be different issue from quoted string.
You might have got to a Gnu LD bug.

As with lld, I would like to treat any whitespace be just ignored and an 
error be provided to fix the default case which I just mentioned. This 
makes the behavior consistent with lld.

OUTPUT_FORMAT doesnot specify a filename though.

Thanks

Shankar Easwaran


-- 
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, hosted by the Linux Foundation




More information about the llvm-commits mailing list