Subject: Re: troubled by GAS
To: None <ediger@metamatic.denver.co.us>
From: Paul Kranenburg <pk@cs.few.eur.nl>
List: port-sparc
Date: 02/22/1996 01:08:40
> It appears that GAS (GNU assembler version 1.92.3, NetBSD $Revision: 1.3 $)
> doesn't do the ".align" assembler directives correctly.  The SPARC code
> generator that comes with the lcc 3.5 distribution generates assembly for bss
> segment data that looks like this.
> 
> .seg "bss"
> .align 1
> .reserve _buf,4610,"bss"
> .align 4
> .reserve _bsize,4,"bss"

Sorry, `.seg "bss"' is not supported in the version of gas that's currently
used in NetBSD. Allocation in the BSS segment is handled by a different
mechanism than in TEXT or DATA segments. In fact, the `.align's in this
example wind up in the data segment (it would probably be better to issue
a warning if a `.seg bss' is seen).

To allocate commons, use `.lcomm' or `.reserve' (the latter is for SunOS as
compatibility) exclusively. Note that you can specify the alignment as
an optional fourth argument to `.reserve'. In this case,

  .reserve _bsize,4,"bss",4

would do the trick.

-pk