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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi All,

In looking at booting a raw x86 kernel image, I discovered that the
compressed image in bzImage is actually an ELF image created with:

objcopy -R .comment -S vmlinux

After decompressing the image, the parse_elf() function in misc.c copies
the sections from the ELF image (there are 3 sections, only 2 are marked
PT_LOAD) into their final resting place in memory. This got me to thinking,
why not use:

objcopy -O binary -R .comment -S vmlinux

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.

Now there is some adjustment in parse_elf() for relocatable kernels, but I
can't but think that this could be simply catered for in the decompression
target address

Surely this would speed up kernel loading by removing the additional copy
that parse_elf() introduces

Or am I missing something significant?

Regards,

Graeme

_______________________________________________
Kernelnewbies mailing list
Kernelnewbies@xxxxxxxxxxxxxxxxx
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux