[PATCH][Binutils][Arm] BFD: Exclude sections with no content from compress check.

Tamar Christina Tamar.Christina@arm.com
Tue Apr 21 14:01:23 GMT 2020


Thanks Alan,

Sorry I hadn't noticed the long line, I'll correct and commit.

Thanks,
Tamar

> -----Original Message-----
> From: Alan Modra <amodra@gmail.com>
> Sent: Tuesday, April 21, 2020 2:59 PM
> To: Tamar Christina <Tamar.Christina@arm.com>
> Cc: binutils@sourceware.org; Richard Earnshaw
> <Richard.Earnshaw@arm.com>; nd <nd@arm.com>; Ramana Radhakrishnan
> <Ramana.Radhakrishnan@arm.com>
> Subject: Re: [PATCH][Binutils][Arm] BFD: Exclude sections with no content
> from compress check.
> 
> On Tue, Apr 21, 2020 at 02:41:52PM +0100, Tamar Christina wrote:
> > Hi All,
> >
> > The check in bfd_get_full_section_contents is trying to check that we
> > don't allocate more space for a section than the size of the section is on
> disk.
> >
> > Previously we excluded linker created sections since they didn't have
> > a size on disk.  However we also need to exclude sections with no
> > content as well such as the BSS section.  Space for these would not
> > have been allocated by the assembler and so the check would incorrectly
> fail.
> >
> > build on native hardware and regtested on
> >   aarch64-none-elf, aarch64-none-elf (32 bit host),
> >   aarch64-none-linux-gnu, aarch64-none-linux-gnu (32 bit host),
> >   arm-none-eabi, arm-none-eabi (32 bit host),
> >   arm-none-linux-gnueabihf, arm-none-linux-gnueabihf (32 bit host)
> >
> > Cross-compiled and regtested on
> >   aarch64-none-linux-gnu, aarch64_be-none-linux-gnu,
> >   arm-none-eabi, armeb-none-eabi, arm-wince-pe
> >
> > and no issues.
> >
> > Ok for master? and for backport to binutils-2.34?
> 
> OK for both, except
> 
> > +	      && (bfd_section_flags (sec) & SEC_HAS_CONTENTS) ==
> > +SEC_HAS_CONTENTS
> the line is more than 80 chars, so we usually would write
> 	      && (bfd_section_flags (sec) & SEC_HAS_CONTENTS) != 0
> 
> --
> Alan Modra
> Australia Development Lab, IBM


More information about the Binutils mailing list