public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
* Linker -T Option
@ 2011-05-03  5:08 Ajay Jain
  2011-05-03  7:53 ` Alan Modra
  0 siblings, 1 reply; 2+ messages in thread
From: Ajay Jain @ 2011-05-03  5:08 UTC (permalink / raw)
  To: binutils

Hi Experts,

I am confused on seeing a build snippet working fine:
powerpc-linux-gnu-gcc -T my.lds test.o -o test

As per my understanding, I need to give a -Wl,T option for this to work i.e.
powerpc-linux-gnu-gcc -Wl,-T my.lds test.o -o test

(1) How is this working with -Wl?
(2) This lds creates a section after ro data. I was under the
impression that any lds specified with -T is independent and complete.
But if this lds is declaring just one section, then how does the code
link?

Thanks,
Ajay.

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: Linker -T Option
  2011-05-03  5:08 Linker -T Option Ajay Jain
@ 2011-05-03  7:53 ` Alan Modra
  0 siblings, 0 replies; 2+ messages in thread
From: Alan Modra @ 2011-05-03  7:53 UTC (permalink / raw)
  To: Ajay Jain; +Cc: binutils

On Tue, May 03, 2011 at 10:38:01AM +0530, Ajay Jain wrote:
> I am confused on seeing a build snippet working fine:
> powerpc-linux-gnu-gcc -T my.lds test.o -o test
> 
> As per my understanding, I need to give a -Wl,T option for this to work i.e.
> powerpc-linux-gnu-gcc -Wl,-T my.lds test.o -o test
> 
> (1) How is this working with -Wl?
> (2) This lds creates a section after ro data. I was under the
> impression that any lds specified with -T is independent and complete.
> But if this lds is declaring just one section, then how does the code
> link?

gcc understands the -T flag, and passes it on to ld.  Does your script
use INSERT?  If it does, then -T does not stop the linker using the
default script.  If it doesn't use INSERT, then other sections are
handled as orphans.

-- 
Alan Modra
Australia Development Lab, IBM

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2011-05-03  7:53 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-05-03  5:08 Linker -T Option Ajay Jain
2011-05-03  7:53 ` Alan Modra

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).