ld: kernel.debug: Not enough room for program headers (allocated 5, need 6)

Artem Belevich art at freebsd.org
Thu Nov 17 16:15:00 UTC 2011


On Thu, Nov 17, 2011 at 6:41 AM, David Wolfskill <david at catwhisker.org> wrote:
> MAKE=/usr/obj/usr/src/make.i386/make sh /usr/src/sys/conf/newvers.sh GENERIC
> cc -c -O -pipe  -std=c99 -g -Wall -Wredundant-decls -Wnested-externs -Wstrict-prototypes  -Wmissing-prototypes -Wpointer-arith -Winline -Wcast-qual  -Wundef -Wno-pointer-sign -fformat-extensions -nostdinc  -I. -I/usr/src/sys -I/usr/src/sys/contrib/altq -D_KERNEL -DHAVE_KERNEL_OPTION_HEADERS -include opt_global.h -fno-common -finline-limit=8000 --param inline-unit-growth=100 --param large-function-growth=1000  -mno-align-long-strings -mpreferred-stack-boundary=2  -mno-mmx -mno-3dnow -mno-sse -mno-sse2 -mno-sse3 -ffreestanding -fstack-protector -Werror  vers.c
> linking kernel.debug
> ld: kernel.debug: Not enough room for program headers (allocated 5, need 6)
> ld: final link failed: Bad value
> *** Error code 1

> I'm rather left wondering "room" where, precisely?

Room for the program headers at the beginning of the ELF file. Look at
sys/conf/ldscript.* and search for SIZEOF_HEADERS.
One way to work around the issue is to replace SIZEOF_HEADERS with a
fixed value. Try 0x1000.

--Artem


More information about the freebsd-stable mailing list