This is the mail archive of the
elfutils-devel@sourceware.org
mailing list for the elfutils project.
Re: [PATCH] libelf: Don't extend ELF file size with SHT_NOBITS sh_offset.
- From: Mark Wielaard <mjw at redhat dot com>
- To: elfutils-devel at lists dot fedorahosted dot org
- Date: Fri, 27 Mar 2015 23:06:26 +0100
- Subject: Re: [PATCH] libelf: Don't extend ELF file size with SHT_NOBITS sh_offset.
On Mon, 2015-03-23 at 22:46 +0100, Mark Wielaard wrote:
> Don't explicitly extend the file size for SHT_NOBITS sections. Since
> that could cause a size beyond any actual file content it will cause
> issues when the underlying ELF file has been mmapped or will extend
> the file size to increase (writing fill bytes) when not mmapped. The
> sh_offset value is essentially meaningless for SHT_NOBITS. gabi says
> that a NOBITS section sh_offset member locates the "conceptual
> placement" in the file. But it doesn't say this cannot be beyond the
> enf of the file. When ELF_F_LAYOUT is set we should trust sh_offset
> as given is what is wanted for an SHT_NOBITS section without extending
> the file size.
I pushed this to master.