Creating a library

So far we have two .o files with object code. One has a main function and will become our program. The other one contains only one function which is used by our program. We can now decide to create a library and store all our helper functions there. This is done with ar myStuff.a myfunction.o . Use ar -t myStuff.a to look at the contents of the archive myStuff.a

  ar -t myStuff.a:

  myfunction..

That's the only function in our library for now. But there where more undefined externals in myCfile.o: U ___main U __alloca . These are functions that live in the standard C library libc.a. The compiler (gcc) will automatically search for unresolved symbols in this library.