[Dwarf-Discuss] Section offset values

Jonas Maebe jonas.maebe@elis.ugent.be
Mon Oct 25 12:44:08 GMT 2010


On 25 Oct 2010, at 14:31, Jakub K?oustek wrote:

> As I read in the DWARF Debugging Standard, the ".long .Ldebug_info0"
> attribute in section .debug_pubnames means "The offset from the
> beginning of the .debug_info section ...". But the ".long" directive
> tells the assembler to store absolute address of the .Ldebug_info0  
> label
> (as is usual in most assemblers), not the section relative address,
> which will look like:
>
> .long .Ldebug_info0-.Ldebug_info0
>
> My question is: how will the assembler figure out that it must store  
> an
> address from the beginning of a section and not an absolute address?

It doesn't. For some reason, ELF (at least on Linux and FreeBSD)  
simply does not follow the DWARF standard in this respect and stores  
absolute addresses for the address of the abbreviation table and the  
DW_AT_stmt_list attribute.


Jonas



More information about the Dwarf-discuss mailing list