This is the mail archive of the binutils@sourceware.org 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: leading padding in ELF segment


> The first segment contains exactly the .text section.  The 2nd segment
> starts immediately after that, so the .data section is some 0x15d8 bytes
> into it.  The .text section's file offset is aligned to the .text section's
> alignment.  The .data section's file offset is not so aligned.  Although I
> can't find words in the ELF spec to suppose that a section's file offset
> should be aligned, Diab does seem to be behaving inconsistently here.
>
> Question:  Is this a well formed ELF file?  AFAICT it is.

I've also seen armcc generate similar things.

Many OS require the file offset to be aligned so they can use mmap, but I 
think that's an OS specific requirements on top of the basic ELF spec.

Paul


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