From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 8499E396E038; Wed, 11 Mar 2020 23:18:02 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 8499E396E038 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1583968682; bh=DDgbjDlJ11ViJVcUTtisRf9xpjjIGUhfpkCyVq2y+j0=; h=From:To:Subject:Date:In-Reply-To:References:From; b=SBKYPs1SiwfbSM0uBZebPelsAzNfNs8hkGZ4NwretJRUXA8tZ6nE/6uY9P5Y+ewIk 7h2M2ebrStt+ClfcfQsNdnwZV85bq3QMLgadmYNi6mS9/dg9HQcsljAW/ZiXhNC4FC fdK47MNX7XMYKPGa5NOtQYE8RltnyjkF4wLuePpM= From: "casner at acm dot org" To: gcc-bugs@gcc.gnu.org Subject: [Bug target/94134] pdp11-aout puts initial variable into .text section rather than .data Date: Wed, 11 Mar 2020 23:18:02 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: target X-Bugzilla-Version: 10.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: casner at acm dot org X-Bugzilla-Status: ASSIGNED X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: jakub at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-BeenThere: gcc-bugs@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-bugs mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Mar 2020 23:18:02 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D94134 --- Comment #12 from Stephen Casner --- (In reply to pkoning from comment #11) > (In reply to Stephen Casner from comment #9) > > 7. Emitting the zero-initialized variable into .data when it happens to > > follow a nonzero-initialized variable is also not correct, or at least > > suboptimal. If there is a vary large uninitialized array, that would m= ake > > the final executable output file much larger. (OK, these days a full 6= 4KB > > is still a pittance, but on principal it's suboptimal.) Therefore, > > switching to .bss in ASM_OUTPUT{_ALIGNED{,_DECL}_}_LOCAL is good. >=20 > Yes, if the assembler/linker supports that, but my understanding is that > they do not. It would be lovely if we could have ELF for pdp11... Although .bss is not defined as a general GNU Assembler directive, it is defined as a PDP-11 dependent feature. It was also included in the PDP11 U= nix assembly language as produced by cc on 2.11BSD, for example: user[47] cat > array.c static int zero[1000]; static int one[1000] =3D { 1 }; int main() {} user[48] cc -S -o array.s array.c user[49] cat array.s .globl=20=20 .bss _zero: .=3D.+3720 .data _one: 1 .=3D.+3716 .globl _main .text _main: ~~main: jsr r5,csv jbr L1 L2:L3:jmp cret L1:jbr L2 .globl .data user[50]=20 This array.s is not accepted by GNU as because of the .globl without a symb= ol, the constant 1 without .word, and the jbr mnemonic.=