How to link a "hello.o" object file manually using ld.exe?
Nick Clifton
nickc@redhat.com
Thu Nov 20 11:06:00 GMT 2008
Hi Fei,
> The thing is I already have a "hello.o" generated by as.exe, and want
> to link this object file manually by using ld.exe instead of gcc.exe.
Why do you want to do this ? gcc.exe will build a correct command line
to invoke the linker for you, so why do you want to handle this yourself ?
> But I don't know what else .o and .a library files I should link
> together with this "hello.o".
If you add the "-v" switch to the gcc.exe command line when you link
hello.o you will see the command line that gcc uses to invoke the
linker. This will tell you what extra files you need on your hand-built
linker command line. ie run:
gcc.exe -v hello.o
Cheers
Nick
More information about the Binutils
mailing list