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.
This commit is contained in:
parent
39a7b38fac
commit
c36876fe5b
@ -1,3 +1,9 @@
|
||||
2020-04-21 Tamar Christina <tamar.christina@arm.com>
|
||||
|
||||
PR binutils/24753
|
||||
* compress.c (bfd_get_full_section_contents): Exclude sections with no
|
||||
content.
|
||||
|
||||
2020-04-21 H.J. Lu <hongjiu.lu@intel.com>
|
||||
|
||||
PR ld/25849
|
||||
|
@ -255,6 +255,9 @@ bfd_get_full_section_contents (bfd *abfd, sec_ptr sec, bfd_byte **ptr)
|
||||
/* PR 24753: Linker created sections can be larger than
|
||||
the file size, eg if they are being used to hold stubs. */
|
||||
&& (bfd_section_flags (sec) & SEC_LINKER_CREATED) == 0
|
||||
/* PR 24753: Sections which have no content should also be
|
||||
excluded as they contain no size on disk. */
|
||||
&& (bfd_section_flags (sec) & SEC_HAS_CONTENTS) != 0
|
||||
/* The MMO file format supports its own special compression
|
||||
technique, but it uses COMPRESS_SECTION_NONE when loading
|
||||
a section's contents. */
|
||||
|
@ -1,3 +1,9 @@
|
||||
2020-04-21 Tamar Christina <tamar.christina@arm.com>
|
||||
|
||||
PR binutils/24753
|
||||
* testsuite/gas/arm/pr24753.d: New test.
|
||||
* testsuite/gas/arm/pr24753.s: New test.
|
||||
|
||||
2020-04-21 H.J. Lu <hongjiu.lu@intel.com>
|
||||
|
||||
PR gas/23840
|
||||
|
7
gas/testsuite/gas/arm/pr24753.d
Normal file
7
gas/testsuite/gas/arm/pr24753.d
Normal file
@ -0,0 +1,7 @@
|
||||
#skip: *-*-pe *-*-wince *-*-vxworks
|
||||
#objdump: -d
|
||||
#name: PR24753: Don't error on sections with no content size mismatch with file
|
||||
|
||||
.*: +file format .*arm.*
|
||||
|
||||
#...
|
12
gas/testsuite/gas/arm/pr24753.s
Normal file
12
gas/testsuite/gas/arm/pr24753.s
Normal file
@ -0,0 +1,12 @@
|
||||
.text
|
||||
.global _start
|
||||
_start:
|
||||
nop
|
||||
|
||||
.section .text2, "ax", %progbits
|
||||
_func:
|
||||
nop
|
||||
|
||||
.bss
|
||||
.fill 0x8000
|
||||
|
Loading…
x
Reference in New Issue
Block a user