This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: Linker -T Option
- From: Alan Modra <amodra at gmail dot com>
- To: Ajay Jain <ajay050 at gmail dot com>
- Cc: binutils at sourceware dot org
- Date: Tue, 3 May 2011 17:22:53 +0930
- Subject: Re: Linker -T Option
- References: <BANLkTi=zDFZn0OOJ2J=cE7QXYLZwa_xi3Q@mail.gmail.com>
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