public inbox for gdb-testers@sourceware.org
help / color / mirror / Atom feed
* [binutils-gdb] BFD: Exclude sections with no content from compress check.
@ 2020-05-05  2:33 gdb-buildbot
  2020-05-05  2:33 ` Failures on Fedora-i686, branch master gdb-buildbot
                   ` (8 more replies)
  0 siblings, 9 replies; 10+ messages in thread
From: gdb-buildbot @ 2020-05-05  2:33 UTC (permalink / raw)
  To: gdb-testers

*** TEST RESULTS FOR COMMIT c36876fe5b5bac1c404ab2ca82bfbfb2ed9a2717 ***

commit c36876fe5b5bac1c404ab2ca82bfbfb2ed9a2717
Author:     Tamar Christina <tamar.christina@arm.com>
AuthorDate: Tue Apr 21 15:16:21 2020 +0100
Commit:     Tamar Christina <tamar.christina@arm.com>
CommitDate: Tue Apr 21 15:17:18 2020 +0100

    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.

diff --git a/bfd/ChangeLog b/bfd/ChangeLog
index 8bc7ee979d..0712414952 100644
--- a/bfd/ChangeLog
+++ b/bfd/ChangeLog
@@ -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
diff --git a/bfd/compress.c b/bfd/compress.c
index ce6bb2beae..728ba39dfb 100644
--- a/bfd/compress.c
+++ b/bfd/compress.c
@@ -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.  */
diff --git a/gas/ChangeLog b/gas/ChangeLog
index 3185bdcf36..757263330c 100644
--- a/gas/ChangeLog
+++ b/gas/ChangeLog
@@ -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
diff --git a/gas/testsuite/gas/arm/pr24753.d b/gas/testsuite/gas/arm/pr24753.d
new file mode 100644
index 0000000000..01990d1ff5
--- /dev/null
+++ b/gas/testsuite/gas/arm/pr24753.d
@@ -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.*
+
+#...
diff --git a/gas/testsuite/gas/arm/pr24753.s b/gas/testsuite/gas/arm/pr24753.s
new file mode 100644
index 0000000000..5ba33fd29c
--- /dev/null
+++ b/gas/testsuite/gas/arm/pr24753.s
@@ -0,0 +1,12 @@
+.text
+.global _start
+_start:
+	nop
+
+.section .text2, "ax", %progbits
+_func:
+	nop
+
+.bss
+.fill 0x8000
+


^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2020-05-11  5:01 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-05-05  2:33 [binutils-gdb] BFD: Exclude sections with no content from compress check gdb-buildbot
2020-05-05  2:33 ` Failures on Fedora-i686, branch master gdb-buildbot
2020-05-05  3:07 ` Failures on Fedora-x86_64-cc-with-index, " gdb-buildbot
2020-05-05  3:19 ` Failures on Fedora-x86_64-m32, " gdb-buildbot
2020-05-05  3:38 ` Failures on Fedora-x86_64-m64, " gdb-buildbot
2020-05-05  4:19 ` Failures on Fedora-x86_64-native-extended-gdbserver-m64, " gdb-buildbot
2020-05-05  4:21 ` Failures on Fedora-x86_64-native-extended-gdbserver-m32, " gdb-buildbot
2020-05-06  3:14 ` Failures on Fedora-x86_64-native-gdbserver-m32, " gdb-buildbot
2020-05-07 10:16 ` Failures on Fedora-x86_64-native-gdbserver-m64, " gdb-buildbot
2020-05-11  5:01 ` Failures on Ubuntu-Aarch64-native-gdbserver-m64, " gdb-buildbot

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).