working with debug symbols

Nikos Karampatziakis just.nikos@gmail.com
Wed May 19 13:45:00 GMT 2010


Hi Nick,

On Wed, May 19, 2010 at 7:18 AM, Nick Clifton <nickc@redhat.com> wrote:
> Hi Nikos,
>
>> I am working on a project where, ideally, we would like to be able to
>> say for every byte in the .text section of an (ELF or PE) executable,
>> whether or not it is part of an instruction or not (i.e. whether it's
>> code or data). The executables will be compiled with gcc and debugging
>> information. At which granularity can we extract this information from
>> the debug symbols?
>
> It depends upon the architecture that you are examining.  For example it
> would normally be reasonable to assume that every byte inside a function is
> part of an instruction, and so given a function's start address and its
> length you can make reasonable estimates as to the location of every
> instruction byte.  But if the compiler for the target architecture places
> constant pools inside functions then the assumption does not hold.
>

We are interested in x86 for now. Are the jump tables for switch
statements stored inside the functions?

Best,
-Nikos



More information about the Binutils mailing list