When I try to link a large program I get this error: /usr/bin/ld: ./ise_testall: Not enough room for program headers (allocated 6, need 7) /usr/bin/ld: final link failed: Bad value collect2: ld returned 1 exit status make: *** [ise_testall] Error 1 I'm not sure what this error means. When I reduce the size of the program by recompiling with fewer internal tests, the link works OK. Any suggestions? ...richie
Well, I can offer a partial answer (from a newer version of the binutils manual): When producing an ELF output file, if the linker script uses the @code{SIZEOF_HEADERS} builtin function, the linker must compute the number of program headers before it has determined all the section addresses and sizes. If the linker later discovers that it needs additional program headers, it will report an error @samp{not enough room for program headers}. To avoid this error, you must avoid using the @code{SIZEOF_HEADERS} function, or you must rework your linker script to avoid forcing the linker to use additional program headers, or you must define the program headers yourself using the @code{PHDRS} command (@pxref{PHDRS}). The linker script in question is presumably one of the default ones (in /usr/lib/ldscripts). The question is what is in your test programs to make them want that 7th program header (if I run "objdump -p /bin/ls" it shows 6 program headers). I'm not sure exactly what to look for, but something along the lines of asm() statements with ".section" would be one example of the kind of thing which might be relevant.
It looks like in this case a customized linker script is needed (like emacs does). I suggest you report the problem to the binutils maintainers if you'd like the default values changed.