This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: [PATCH] Use offsets instead of addresses in ELF_SECTION_IN_SEGMENT
- From: Alan Modra <amodra at gmail dot com>
- To: Alan Hayward <Alan dot Hayward at arm dot com>
- Cc: "binutils at sourceware dot org" <binutils at sourceware dot org>, nd <nd at arm dot com>
- Date: Thu, 21 Jun 2018 08:29:23 +0930
- Subject: Re: [PATCH] Use offsets instead of addresses in ELF_SECTION_IN_SEGMENT
- References: <20180522105215.3339-1-alan.hayward@arm.com> <20180522140439.GA23663@bubble.grove.modra.org> <A5D2296E-1D3D-4CD0-A3E9-BFFC3C18242A@arm.com> <20180523133925.GB23663@bubble.grove.modra.org> <84744090-4EA3-47A3-9E36-A2220426E5E0@arm.com> <20180525031713.GI23663@bubble.grove.modra.org> <1104BC2E-9FDF-4061-91BB-501CD6637397@arm.com>
On Mon, Jun 18, 2018 at 02:29:05PM +0000, Alan Hayward wrote:
> * include/elf/internal.h (ELF_SECTION_IN_SEGMENT): Don’t check
> addresses for non SHT_NOBITS.
>
>
> diff --git a/include/elf/internal.h b/include/elf/internal.h
> index 05f9fab89cbe2aee94006d18a689cb01e101776f..b012820f6cf9c7e6b5879748b0b05685594987bb 100644
> --- a/include/elf/internal.h
> +++ b/include/elf/internal.h
> @@ -342,8 +342,10 @@ struct elf_segment_map
> && (((sec_hdr)->sh_offset - (segment)->p_offset \
> + ELF_SECTION_SIZE(sec_hdr, segment)) \
> <= (segment)->p_filesz))) \
> - /* SHF_ALLOC sections must have VMAs within the segment. */ \
> + /* SHT_NOBITS sections with SHF_ALLOC must have VMAs within the \
> + segment. */ \
> && (!(check_vma) \
> + || (sec_hdr)->sh_type != SHT_NOBITS \
> || ((sec_hdr)->sh_flags & SHF_ALLOC) == 0 \
> || ((sec_hdr)->sh_addr >= (segment)->p_vaddr \
> && (!(strict) \
This looks reasonable to me. OK to apply.
--
Alan Modra
Australia Development Lab, IBM