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

Tamar Christina tamar.christina@arm.com
Tue Apr 21 13:41:52 GMT 2020


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?

Thanks,
Tamar

bfd/ChangeLog:

2020-04-21  Tamar Christina  <tamar.christina@arm.com>

	* compress.c (bfd_get_full_section_contents): Exclude sections with no
	content.

gas/ChangeLog:

2020-04-21  Tamar Christina  <tamar.christina@arm.com>

	* testsuite/gas/arm/pr24753.d: New test.
	* testsuite/gas/arm/pr24753.s: New test.

-- 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: rb12947.patch
Type: text/x-diff
Size: 1614 bytes
Desc: not available
URL: <https://sourceware.org/pipermail/binutils/attachments/20200421/e77a1861/attachment.bin>


More information about the Binutils mailing list