[Gold] Can't we specify input files & libraries in linker scripts ?

Shawn shaolin.xie@ia.ac.cn
Tue Aug 13 01:00:00 GMT 2013


Thanks, cary, It's ok to put the input files & libraries on the command 
line, but it's inconvenient to the end user, such as :
ld.gold crt0 -lm -lc -lgloss_mspu -lcompiler_rt inputfile.o

If we can specify the default files & libraries(such as crt0, -lc, 
-lgloss_mspu -lcompiler_rt) in a linker script, say script.ld, it will 
be more concise:
ld.gold -T script.ld inputfile.o

-Shawn

On 2013年08月13日 05:24, Cary Coutant wrote:
>> It's ok to specify the input files & libraries in the command line,But  if
>> we add default libraries to be linked in linker script with the "GROUP"
>> clause, "internal error" occurs.  This "internal error" occurs because of
>> the  assertion in binutlis-2.23.2/gold/script.cc:1600 ,which says :
>>
>> gold_assert(!closure.saw_inputs());
>>
>> Does it means we can't specify any input files & libraries in linker script
>> ?
> You can specify input files and libraries in a script that you put on
> the command line as an ordinary input file (i.e., with no
> -T/--script/--version-script option). If you see this error, it's
> probably because you used -T/--script.
>
> It's a bug, though, that you see an internal error instead of a
> reasonable error message explaining what was wrong.
>
> -cary
>


-- 
============================
中国科学院自动化研究所 谢少林
电话: 010-62620080-777




More information about the Binutils mailing list