What is the purpose of parse_elf() in misc.c

Mulyadi Santosa mulyadi.santosa at gmail.com
Fri Dec 2 00:41:33 EST 2011


Hi Graeme....

On Fri, Nov 25, 2011 at 12:30, Graeme Russ <graeme.russ at gmail.com> wrote:
> I wrote a little stand-alone parse_elf() program, and lo-and-behold, the
> outputs are identical. So, in theory, if bzImage contained a raw binary, it
> could be decompressed directly to the target address.

I find your experiment quite interesting. After looking at parse_elf
(http://lxr.linux.no/#linux+v3.1.4/arch/x86/boot/compressed/misc.c#L276),
I guess it could be codes introduced long time before objcopy support
"binary" form. And since then is rarely touched again.

But maybe it's left there in case there is a platform that doesn't
have objcopy version that supports "binary" form conversion. So I
think it's more about portability issue.

-- 
regards,

Mulyadi Santosa
Freelance Linux trainer and consultant

blog: the-hydra.blogspot.com
training: mulyaditraining.blogspot.com



More information about the Kernelnewbies mailing list