I was trying to do
ld -r -o test.o lib.a
It worked but test.o ended up being very small file even though lib.a
large file.
But if I do
ld -r -o test.o obj1.o obj2.o etc
It seems to work. Just link all object files in lib.a
)
Essentially is there a way to tell ld
to take all the object files out of .a
and link them ?
I’m asking because trying speed up build which creates hundreds of executables but always links with same libraries. Wanted to instead try linking with one big .o
file to resolve as much reference as possible before hand. Basically don’t have ld
repeat same work each time.