Subject: Re: kern/21844: netwinder kernal cannot be linked because link_set_* sections overlap with .data
To: None <email@example.com>
From: Christos Zoulas <firstname.lastname@example.org>
Date: 06/12/2003 13:33:10
In article <email@example.com>,
Ian Lance Taylor <firstname.lastname@example.org> wrote:
Well, as long as we are on the subject of gld, I have a question:
I am trying to put a NetBSD ident section in the kernel. The code
is #ifdef notyet in /usr/src/sys/conf/newvers.sh because I don't
know how to convince the linker to work. When I enable it, the
ld: netbsd: Not enough room for program headers (allocated 3, need 4)
ld: final link failed: Bad value
This is because the ident section is:
"\t.long\t" _S(ELF_NOTE_NETBSD_NAMESZ) "\n"
"\t.long\t" _S(ELF_NOTE_NETBSD_DESCSZ) "\n"
"\t.long\t" _S(ELF_NOTE_TYPE_NETBSD_TAG) "\n"
"\t.ascii\t" _S(ELF_NOTE_NETBSD_NAME) "\n"
"\t.long\t" _S(__NetBSD_Version__) "\n"
And this ident section causes another program header to be allocated?!?
How do I fix this?
>I don't know what ``as-is'' would mean in this case. Anyhow, if the
>GNU linker docs imply that, they are wrong. The GNU linker for ELF
>sorts orphaned sections by guessing where it thinks they should go
>based on their characteristics.
>If the docs are really misleading, I encourage you to send a bug
>report to email@example.com, or just to me.