Creating a Relocatable Object

To create a relocatable object use the -r option.

$ ld -r -o temp.o file1.o file2.o file3.o ....