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: PATCH: Fix linker plugin support for gnu linker


On Sat, Jan 8, 2011 at 4:10 AM, Richard Sandiford
<rdsandiford@googlemail.com> wrote:
> "H.J. Lu" <hongjiu.lu@intel.com> writes:
>> This patch fixes linker plugin support for gnu linker with 2 stage
>> linking and supports mixed LTO objects:
>>
>> http://www.kernel.org/pub/linux/devel/gcc/lto/mixed-IR/mixed-IR.pdf
>>
>> Any objections?
>
> One problem with the patch as written is that it doesn't cope with
> the kind of embedded setup in which the startup file is specified
> in a linker script. ?E.g. on mipsisa64-elf, GCC doesn't know what
> system you're targetting, and therefore doesn't what startup files or
> board-specific libraries are needed. ?You instead link with something
> like -Tidt64.ld. ?idt64.ld then contains:
>
> STARTUP(crt0.o)
>
> -T options are parsed immediately in-place, and don't show up in the
> cmdline_options. ?Things like STARTUP don't either. ?This means that
> crt0.o is dropped by the second stage link.
>
> The handling of -T also means that the system libraries:
>
> GROUP(-lc -lidt -lgcc)
>
> don't show up in the second link. ?However, that brings up a broader
> question (which might already have been answered, sorry). ?The current
> process -- that is, the process before the 2-stage patch -- seems to
> rely on the GCC driver passing the equivalent of:
>
> ?-pass-through=-lgcc -pass-through=-lc -pass-through=-lgcc
>
> to the plugin. ?But on targets like mipsisa64-elf, GCC doesn't know

hjl/lto-mixed branch ignores  -pass-through=XXX passed from gcc driver.
If hjl/lto-mixed branch doesn't work with -Tidt64.ld, please open a bug
report.  I will take a  look.

Thanks.


-- 
H.J.


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