Combining object files

From Attie's Wiki
Revision as of 09:44, 18 October 2011 by Attie (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

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.

Personal tools
Namespaces

Variants
Actions
Navigation
Toolbox