Subject: Re: ddb line number support for ELF
To: Todd Whitesel <toddpw@best.com>
From: John Hawkinson <jhawk@MIT.EDU>
List: tech-kern
Date: 07/27/2000 09:56:36
In message <200007270856.BAA10352@shell17.ba.best.com>, Todd Whitesel writes:
>Sorry, I started checking my usual reference toolchains and couldn't find
>solid evidence for or against PROGBITS, then I ran out of time to look at it
>so I didn't say anything.

OK, great. Knowing that someone has an idea of how this is supposed to
work makes me feel much better.

>> Some have questioned whether .stab should be loaded by default at all;
>> since we already load .stabstr, which is 2x its size, loading .stab
>
>Loading .stabstr by itself is a waste of time. Without the offset values in
>the .stab section, the .stabstr data is just a meaningless pile of C strings.

Yup, understood. The current loading algorithm is:

     Load the phdr stuff
     Check if there's a symtab
       If so, load all symtabs and strtabs

>If all you need is line numbers, you can get away with loading .stab but
>not .stabstr; however if you need to know filenames or function names or
>variable names, then you will need to load both sections.

Yup, we need all three (well, "want" ;-)). Of course, for globals
we already have symbols for functions and variables...

D'you have a recommendation on whether we should load .stab
explicitly by name, or by some other characteristic (i.e. all PROGBITS
that have not been previously loaded, though that'd sort of be a pain).

I'll also update the i386 manpage for boot(8) to indicate what the
from loadfile mean when loading sections. Is there some MI place for
this?

--jhawk