https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94134

--- Comment #12 from Stephen Casner <casner at acm dot org> ---
(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 make
> > the final executable output file much larger.  (OK, these days a full 64KB
> > is still a pittance, but on principal it's suboptimal.)  Therefore,
> > switching to .bss in ASM_OUTPUT{_ALIGNED{,_DECL}_}_LOCAL is good.
> 
> 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 Unix
assembly language as produced by cc on 2.11BSD, for example:

user[47] cat > array.c
static int zero[1000];
static int one[1000] = { 1 };
int main() {}
user[48] cc -S -o array.s array.c
user[49] cat array.s
.globl  
.bss
_zero:
.=.+3720
.data
_one:
1
.=.+3716
.globl  _main
.text
_main:
~~main:
jsr     r5,csv
jbr     L1
L2:L3:jmp       cret
L1:jbr  L2
.globl
.data
user[50] 

This array.s is not accepted by GNU as because of the .globl without a symbol,
the constant 1 without .word, and the jbr mnemonic.

Reply via email to