]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commit
BFD: Exclude sections with no content from compress check.
authorTamar Christina <tamar.christina@arm.com>
Tue, 21 Apr 2020 14:16:21 +0000 (15:16 +0100)
committerTamar Christina <tamar.christina@arm.com>
Tue, 21 Apr 2020 14:23:59 +0000 (15:23 +0100)
commit9f57ab49b32bc14c0ff3834876a185af0a4c6e6b
treeb0621f26d9ca6801ab370c8176b76ff05c372d93
parent99bcb57453769278569b0139c16236200d3c457e
BFD: Exclude sections with no content from compress check.

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.

bfd/ChangeLog:

PR binutils/24753
* compress.c (bfd_get_full_section_contents): Exclude sections with no
content.

gas/ChangeLog:

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

(cherry picked from commit c36876fe5b5bac1c404ab2ca82bfbfb2ed9a2717)
bfd/ChangeLog
bfd/compress.c
gas/ChangeLog
gas/testsuite/gas/arm/pr24753.d [new file with mode: 0644]
gas/testsuite/gas/arm/pr24753.s [new file with mode: 0644]