public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH] djgpp: emit "b" flag for named bss sections
@ 2020-03-25 20:04 J.W. Jagersma
  0 siblings, 0 replies; only message in thread
From: J.W. Jagersma @ 2020-03-25 20:04 UTC (permalink / raw)
  To: gcc-patches; +Cc: J.W. Jagersma

Unlike ELF, named sections such as .bss.* and .gnu.linkonce.b.* have no
special meaning in COFF, therefore they will have the CONTENTS and LOAD
attributes set.  The result is that these sections take up space in
object files and executables.  These attributes can be cleared by
emitting the "b" flag in the .section directive.

This can probably be added in default_coff_asm_named_section too.

gcc/
2020-03-25  Jan W. Jagersma  <jwjagersma@gmail.com>

	* config/i386/djgpp.c (i386_djgpp_asm_named_section): Emit "b"
	flag for SECTION_BSS.
---
 gcc/config/i386/djgpp.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/gcc/config/i386/djgpp.c b/gcc/config/i386/djgpp.c
index ba6c2d4d3a4..88cf1e6506e 100644
--- a/gcc/config/i386/djgpp.c
+++ b/gcc/config/i386/djgpp.c
@@ -36,6 +36,8 @@ i386_djgpp_asm_named_section(const char *name, unsigned int flags,
     *f++ = 'w';
   if (flags & SECTION_CODE)
     *f++ = 'x';
+  if (flags & SECTION_BSS)
+    *f++ = 'b';
 
   /* LTO sections need 1-byte alignment to avoid confusing the
      zlib decompression algorithm with trailing zero pad bytes.  */
-- 
2.25.2


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2020-03-25 20:12 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-03-25 20:04 [PATCH] djgpp: emit "b" flag for named bss sections J.W. Jagersma

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).