[kwlug-disc] why, yes, you *can* help me write my next column, thanks for asking

Kyle Spaans 3lucid at gmail.com
Tue Aug 4 21:57:03 EDT 2009

I might be able to help out a little. I've recently completed a
LinuxFromScratch install, and have been running linux-next kernels
every day.

On Fri, Jul 31, 2009 at 8:58 AM, Robert P. J. Day<rpjday at crashcourse.ca> wrote:
> explaining the layout of a newly-built kernel in terms of its ELF
> layout, and its sections, and how to look at it with, say, nm or
> objdump and that's turning into an entire column all by itself.

I can give some "new to ELF/nm/binutils and don't know what's
what" advice. I was introduced to nm, objdump, ELF, and readelf
this spring in my introductory Operating Systems class. I'm used
to looking at disassembly dumps with objdumps, which is OK if
you know the assembly pretty well (MIPS in my case, a lot simpler
than x86 ASM), and inspecting the segments in an ELF file. The
problem *there* is that the executables we built were
oversimplified with only text and data segments, simplified for our
MIPS emulator target.

I've recently looked at some MIPS object files for a real MIPS
machine that I have access to, and there were dozens of segments
and headers in the ELF file that I knew nothing about. I could figure
it out with my previous experience, but it could be overwhelming to
a newbie who fires off `readelf -a vmlinux`.

>  so, any suggestions as to what you've personally found useful along
> those lines in examining a stock "vmlinux" kernel image with similar
> commands?

`objdump -d ...` and `readelf [-a|-l]`, but maybe explaining "Why we care"
and what the important parts are to look at.

>  i'd start with building a kernel with DEBUG_INFO selected,
> then

I'll get on that tonight when I build from the latest linux-next. :)

>  possibly a bit dry, but the more i think about it, the more i think
> it will be handy to cover all that now as i'm pretty sure i can use it
> later.  certainly in the next column when i cover "gdb" for both the
> kernel and loadable modules.

Dry maybe, but accessible! It's easy to get your toes moist by typing
a couple of commands.

More information about the kwlug-disc mailing list