How Section to Segment mapping is derived from ELF file?

Peng Yu pengyu.ut@gmail.com
Wed Apr 21 15:41:49 GMT 2021


How is this relation figured out by readelf? Could anyone help explain
the details? Thanks.

On 4/21/21, Nick Clifton <nickc@redhat.com> wrote:
> Hi Peng,
>
>> I see there is a mapping between section to segment. It is not quite
>> clear where this mapping is specified in the ELF spec. Could anybody
>> explain how this is derived from the ELF file by readelf?
>
> There is no official definition of this mapping in the ELF
> specification.  It is just a (hopefully) useful addition to readelf's
> output, allowing readers to see what relationship - if any - exists
> between sections and segments.
>
> In theory segments could be completely unrelated to sections.  But in
> practice the linker will arrange that sections with similar
> characteristics will be mapped together and assigned to a segment that
> also matches those characteristics.
>
> Cheers
>    Nick
>
>


-- 
Regards,
Peng


More information about the Binutils mailing list