Subject: Re: kern/13615: NetBSD current requires a .note.netbsd.ident
To: Luke Mewburn <lukem@wasabisystems.com>
From: None <cgd@broadcom.com>
List: netbsd-bugs
Date: 08/03/2001 10:06:19
lukem@wasabisystems.com ("Luke Mewburn") writes:
> On Fri, Aug 03, 2001 at 12:58:00PM +1000, matthew green wrote:
> > but certainly the solution that simply refuses to run correct programs
> > because they don't have a tag is no good. it makes it impossible (sans a
> > kernel rebuild) to run programs that are otherwise completely useful.
>
> what's the feasibility of providing a tool which munges the program to
> set this .note ?
"Shouldn't be too hard," but nobody's done it AFAIK. 8-)
IIRC (it's been a while), to do it right you have to:
* expand the program header,
* add the note entry right up near the program header, hopefully in
the first page/block of the binary,
* move everything else "down a page" in the ELF file, to keep the load
offsets the same modulo page size.
I don't believe anybody's written a tool to do it, but again, it
shouldn't be too hard.
BTW, this would be useful for several reasons. one of which is the
fact that for a long time we've documented but not really supported an
"emulation name" note which should be used to mark existing ELF
binaries to be run with a specific NetBSD emulation (to simplify
detection of emulation type, for hard-to-identify ELF binaries).
The form of that note can be found at:
file:/home/cgd/proj/netbsd/htdocs/Documentation/kernel/elf-notes.html
AFAIK it's never actually been used, so if there's desire to change it
to have some different form that's probably fine...
cgd