To create a relocatable object use the -d n and -r options:
$ cc -dn -r -o temp.o file1.o file2.o file3.o .....