How many object files can I pass to a linking task?

412 views Asked by At

I found this for a vanilla case of Bash on GNU/Linux, but what about other shells, other operating systems and other compilers?

1

There are 1 answers

2
Employed Russian On

How many object files can I pass to a linking task?

Depends on the linker you use.

When using binutils gnu-ld or gold, you can use Windows-style response file, which allows you to bypass command line length limits and pass as many arguments as you need:

echo "foo.o bar.o baz.o ... -lc" > args
gcc main.o -Wl,@args  # there is no limit on how big args file is.