Re: [PATCH] /proc/config.gz against 2.2.3

H. Peter Anvin (hpa@transmeta.com)
18 Mar 1999 09:35:54 GMT


Followup to: <Pine.LNX.4.10.9903171002180.30678-100000@waste.org>
By author: Oliver Xymoron <oxymoron@waste.org>
In newsgroup: linux.dev.kernel
>
> I looked into this. It's ugly. It requires changes to the Makefile and
> link scripts on every architecture. I've discussed this with MEC and we
> came to the conclusion that we need a clean and easy way to include binary
> images as ELF sections in 2.3. I suspect this will involve a helper script
> or program of some sort.
>

objcopy can do this, with the --add-section= directive. Note that
bzImage is *NOT* an ELF object!

As far as converting a binary file to a .o that can be included in
code, GNU ld will do it quite cleanly with:

ld -r -b binary file.bin -o file.o

It creates the symbols _binary_file_bin_{end,size,start} to reference
it.

The only problem is that it puts it in the .data segment, and at least
I can't find a way to put it in the .rodata segment instead. I've
been thinking about submitting a patch to bfd that would define a
"robinary" format (same as binary except it is all .rodata).

> There's actually quite a bit of stuff that's currently arch-specific that
> needn't be.

True enough.

-hpa

-- 
"The user's computer downloads the ActiveX code and simulates a 'Blue
Screen' crash, a generally benign event most users are familiar with
and that would not necessarily arouse suspicions."
-- Security exploit description on http://www.zks.net/p3/how.aspb

- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.rutgers.edu Please read the FAQ at http://www.tux.org/lkml/