This is the mail archive of the binutils@sourceware.org mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: How to link a "hello.o" object file manually using ld.exe?


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]