From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wm1-x343.google.com (mail-wm1-x343.google.com [IPv6:2a00:1450:4864:20::343]) by sourceware.org (Postfix) with ESMTPS id 85635385E006 for ; Wed, 25 Mar 2020 20:12:08 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 85635385E006 Received: by mail-wm1-x343.google.com with SMTP id l20so4397374wmi.3 for ; Wed, 25 Mar 2020 13:12:08 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=tvqdwwCDVBdQGtOE+l6JYmmhFekTljCGMEMgHzQo30s=; b=XXBAPAUYmsO+F6i9Qp2YPNHLCzsyBdKChTT/xY08TKKPbwCAINipO2tVoIRu4+1xGE ycc5xO5djC+p8PUXGF3nMvq+j6PDY7+EPxQtz028qseaV2g5/7mVwbWgxGzenjZDBIDP zQ6JFVv0/gZykh19dWSZTWsJGBhDdjDQ7bVG+n6ibegFc/dpQ5x3TC/biAF4bHlS0b2Y rWjJi+bNzJIHgEVdatvYkr5h/FZzKpQIQeaej02sbgMJANRizw30GzCHCWku4hd/7foB c15kdeLcR7eOwl+bNOJkJcMgwrzesu7bkt0AQgyjoB7+cm5PiIfWYiYV42JqF7QHsU8b Vt6Q== X-Gm-Message-State: ANhLgQ1xpsmAxfGNURD1UBJb5wBba/eIeigmztgwjc8RomKhIM9e8FqT 7EpuK8/NhZnGLDumQQ6dpTXluiMslrY= X-Google-Smtp-Source: ADFU+vuik135Y1WT4YuXX5kJaNwm0MZLtmTELuT40SUKlmJGnQJqZb1bJVgb1showBC0cdROswrCkg== X-Received: by 2002:a1c:9e97:: with SMTP id h145mr736101wme.61.1585167127304; Wed, 25 Mar 2020 13:12:07 -0700 (PDT) Received: from localhost.localdomain (138.sub226.ddfr.nl. [217.27.226.138]) by smtp.gmail.com with ESMTPSA id t126sm224624wmb.27.2020.03.25.13.12.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 25 Mar 2020 13:12:06 -0700 (PDT) From: "J.W. Jagersma" To: gcc-patches@gcc.gnu.org Cc: "J.W. Jagersma" Subject: [PATCH] djgpp: emit "b" flag for named bss sections Date: Wed, 25 Mar 2020 21:04:29 +0100 Message-Id: <20200325200428.40130-1-jwjagersma@gmail.com> X-Mailer: git-send-email 2.25.2 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-29.3 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 25 Mar 2020 20:12:09 -0000 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 * 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