On Tue, 2008-12-09 at 08:10 -0800, Adam Nemet wrote:
> Ian Lance Taylor <[EMAIL PROTECTED]> writes:
> > Ralf Corsepius <[EMAIL PROTECTED]> writes:
> >
> >> So what would you recommend: To use "gcc -r" or "gcc -Wl,-r" ?
> >
> > Ah, when you put the question like that, I would recommend "ld -r".
> > This is the one case where you get no advantage from using the gcc
> > driver to invoke the linker, and it can actually mess you up by adding
> > unexpected files to the command line.
I know - We've recently been bitten by it ;)

> If a different linker emulation needs to be selected you're still better off
> using gcc.  E.g., on linux64 n64 this:
> 
>   gcc -nostdlib -Wl,-r -mabi=64 ...
> 
> is probably easier to remember than this:
> 
>   ld -melf64btsmip -r ...

I guess, I need to provide some background information:

In RTEMS, for historical reasons, we have been using: 
  gcc ... -nostdlib -Wl,-r ...

So, my questions actually were aiming at

* whether
 "gcc ... -nostdlib -r" 
and 
"gcc ... -nostdlib -Wl,-r"
are equivalent 

* if the fact that "gcc -r" appears to work, can be exploited or whether
this is a "random accident" and/or intentionally undocumented feature,
which may go away at any time.

Ralf


Reply via email to