[Dwarf-Discuss] Section offset values
jakub at redhat.com
Mon Nov 8 03:43:01 PST 2010
On Mon, Nov 08, 2010 at 12:30:19PM +0100, Jakub Křoustek wrote:
> On 27.10.2010 15:21, Jakub Kroustek wrote:
> > On 25.10.2010 19:12, David Anderson <davea42 at earthlink.net> wrote:
> >> Check the .rel or .rela section!
> >> When linking is later done the relocation
> >> (which the compiler also creates) will have the right effect.
> > Thanks for hint. In .rela.debug_pubnames section, I see:
> > Offset Info Type Sym. Value Sym. Name + Addend
> > 000000000006 00060000000a R_X86_64_32 0000000000000000 .debug_info + 0
> > That is clear for me, the assembler used a R_X86_64_32 relocation type.
> > But .rel / .rela sections are generated by assembler not by C compiler
> > (gcc -g3 -S test.c), so I still don't know why the assembler used
> > relocation (and this type of relocation) for directive ".long
> > .Ldebug_info0" in section .debug_pubnames. This is not the default
> > behavior of ".long label" directive translation.
> Sorry for reopening, but no one can help with this topic?
I don't understand why do you care.
GCC knows these are offsets to .debug_* sections, i.e. non-allocated
and thus rely on the start of each such section to have address 0,
which is generally true in ELF. It is not true in PE-COFF, which is
why GCC uses different relocations there.
More information about the Dwarf-Discuss