This is the mail archive of the binutils@sources.redhat.com mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: the question about PT_DYNAMIC's p_offset value in elf file formips platform


Hi Eagle,

> I do not know why PT_DYNAMIC's p_offset is 0x0000ac. I think the
> correct value should be 0x1008.

The PT_DYNAMIC segment includes more than just the .dynamic section. It also includes sections like .hash, .dynsym etc. Hence the segment starts at the lowest offset of all of these sections, which in this case is the .hash section.

If you have a look at the section to segment mapping output from readelf:

      Section to Segment mapping:
       Segment Sections...
        00     .hash .dynsym .dynstr .text .MIPS.stubs .rel.dyn
        01     .data .dynamic .got .bss
        02     .reginfo .hash .dynsym .dynstr .text .MIPS.stubs .data
.dynamic .debug_aranges .debug_pubnames .debug_info .debug_abbrev
.debug_line .debug_frame .debug_str .pdr .rel.dyn .compact_rel .shstrtab
.symtab


You can see the relationship between segments and sections.

Cheers
  Nick


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]