This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Re: what is the difference between the two command?
- From: Ian Lance Taylor <iant at google dot com>
- To: horseriver <horserivers at gmail dot com>
- Cc: gcc-help <gcc-help at gcc dot gnu dot org>
- Date: Sat, 19 Jan 2013 21:47:53 -0800
- Subject: Re: what is the difference between the two command?
- References: <20130119061905.GB3025@debian.localdomain>
On Fri, Jan 18, 2013 at 10:19 PM, horseriver <horserivers@gmail.com> wrote:
> hi:
>
> Here are two command for producting one .so file :
>
> 1. gcc -nostdlib -Wl,-T,vsyscall.lds vsyscall-int80.o -o vsyscall-int80.so
>
> 2. ld -T vsyscall.lds vsyscall-int80.o -o vsyscall-int80.so
There is no substantive difference between these commands. There are
various minor differences that probably don't matter. Use the -v
option when invoking gcc to see precisely how it invokes the linker.
In particular, invoking the linker via the gcc driver will cause some
C++-specific operations to occur when needed, but since you aren't
using C++ in this case they won't happen.
Ian