Bug 7292
Summary: | ld fails to link large program | ||
---|---|---|---|
Product: | [Retired] Red Hat Linux | Reporter: | richieb |
Component: | binutils | Assignee: | Cristian Gafton <gafton> |
Status: | CLOSED WONTFIX | QA Contact: | |
Severity: | medium | Docs Contact: | |
Priority: | medium | ||
Version: | 6.1 | ||
Target Milestone: | --- | ||
Target Release: | --- | ||
Hardware: | i386 | ||
OS: | Linux | ||
Whiteboard: | |||
Fixed In Version: | Doc Type: | Bug Fix | |
Doc Text: | Story Points: | --- | |
Clone Of: | Environment: | ||
Last Closed: | 2000-02-04 17:48:43 UTC | Type: | --- |
Regression: | --- | Mount Type: | --- |
Documentation: | --- | CRM: | |
Verified Versions: | Category: | --- | |
oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
Cloudforms Team: | --- | Target Upstream Version: | |
Embargoed: |
Description
richieb
1999-11-24 16:00:21 UTC
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. |