* a simple question about link
@ 2013-01-10 8:54 horseriver
2013-01-10 9:50 ` Игорь Пашев
2013-01-10 10:17 ` nick clifton
0 siblings, 2 replies; 5+ messages in thread
From: horseriver @ 2013-01-10 8:54 UTC (permalink / raw)
To: binutils
hi:
if gcc do not specify a ld-script file for ld , which ld-script ld will use ?
how ld select needed ld-script?
thanks!
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: a simple question about link
2013-01-10 8:54 a simple question about link horseriver
@ 2013-01-10 9:50 ` Игорь Пашев
2013-01-10 10:17 ` nick clifton
1 sibling, 0 replies; 5+ messages in thread
From: Игорь Пашев @ 2013-01-10 9:50 UTC (permalink / raw)
To: horseriver; +Cc: binutils
2013/1/10 horseriver <horserivers@gmail.com>:
> hi:
>
> if gcc do not specify a ld-script file for ld , which ld-script ld will use ?
>
>
> how ld select needed ld-script?
man ld
-Wl,<blah,blah,blah>
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: a simple question about link
2013-01-10 8:54 a simple question about link horseriver
2013-01-10 9:50 ` Игорь Пашев
@ 2013-01-10 10:17 ` nick clifton
2013-01-10 12:31 ` horseriver
1 sibling, 1 reply; 5+ messages in thread
From: nick clifton @ 2013-01-10 10:17 UTC (permalink / raw)
To: horseriver; +Cc: binutils
Hi horseriver,
> if gcc do not specify a ld-script file for ld , which ld-script ld will use ?
The one that is built into the linker. You can see this script by
running the linker directly with the --verbose command line option
specified. Note - slightly different variations of this default linker
script are used when other command line options are also passed to the
linker, eg -N and -r. See the source file ld/genscripts.sh for more
details on this.
Cheers
Nick
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: a simple question about link
2013-01-10 10:17 ` nick clifton
@ 2013-01-10 12:31 ` horseriver
2013-01-11 15:02 ` nick clifton
0 siblings, 1 reply; 5+ messages in thread
From: horseriver @ 2013-01-10 12:31 UTC (permalink / raw)
To: nick clifton; +Cc: binutils
On Thu, Jan 10, 2013 at 10:06:54AM +0000, nick clifton wrote:
> Hi horseriver,
>
> > if gcc do not specify a ld-script file for ld , which ld-script ld will use ?
>
> The one that is built into the linker.
Thanks!
After installing ld , there is a folder named "ldscripts" under ld's home directory , which can be set by --prefix configure option .
Under /usr/lib folder , there is also a folder named "ldscripts" .
what is the difference between them ? ld will use which ?
> You can see this script by
> running the linker directly with the --verbose command line option
> specified. Note - slightly different variations of this default
> linker script are used when other command line options are also
> passed to the linker, eg -N and -r. See the source file
> ld/genscripts.sh for more details on this.
>
> Cheers
> Nick
>
>
>
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: a simple question about link
2013-01-10 12:31 ` horseriver
@ 2013-01-11 15:02 ` nick clifton
0 siblings, 0 replies; 5+ messages in thread
From: nick clifton @ 2013-01-11 15:02 UTC (permalink / raw)
To: horseriver; +Cc: binutils
Hi horseriver,
> After installing ld , there is a folder named "ldscripts" under
> ld's home directory , which can be set by --prefix configure option .
> Under /usr/lib folder , there is also a folder named "ldscripts" .
> what is the difference between them ?
/usr/lib/ldscripts belongs to the system linker (ie /bin/ld).
<prefix>/lib/ldscripts belongs to the linker that you installed into
<prefix>, ie <prefix>/bin/ld.
> ld will use which ?
Neither. :-) It will use the versions of these scripts that are built
directly into the ld binary itself. Try running strings on the ld
executable to see this.
Cheers
Nick
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2013-01-11 15:02 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-01-10 8:54 a simple question about link horseriver
2013-01-10 9:50 ` Игорь Пашев
2013-01-10 10:17 ` nick clifton
2013-01-10 12:31 ` horseriver
2013-01-11 15:02 ` nick clifton
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).