COFF link

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
Post Reply
be

COFF link

Post by be »

How can I copy multiple COFF .o files into one big .o file without linking with DJGPP? I want to make one big .o file which will be linked with other small one to the elf later. But ld does not understand and says that he does not know function I call (which declared in the last small .o file). :-[
User avatar
Pype.Clicker
Member
Member
Posts: 5964
Joined: Wed Oct 18, 2006 2:31 am
Location: In a galaxy, far, far away
Contact:

Re:COFF link

Post by Pype.Clicker »

you could link them with using some special flag (-r iirc for incremental linking), which makes it keep relocation & stuff.
Tim

Re:COFF link

Post by Tim »

Alternatively, you could put all the object files in a library:

Code: Select all

ar rcs libkernel.a file1.o file2.o file3.o
ld -o kernel startup.o main.o libkernel.a
Post Reply