Combining object files
From Attie's Wiki
(Difference between revisions)
m (Created page with 'First build some objects <source lang="bash"> gcc a.c -c -o a.o gcc b.c -c -o b.o </source> Now, if you wanted to combine these into a single object file, do this: <source lang=…') |
Latest revision as of 09:44, 18 October 2011
First build some objects
gcc a.c -c -o a.o gcc b.c -c -o b.o
Now, if you wanted to combine these into a single object file, do this:
ld -r a.o b.o -o ab.o
This is used by many large projects, including the Linux kernel & u-boot.