Subject: Re: more on sparc svr4 emul problem
To: Klaus Klein <kleink@ira.uka.de>
From: Chuck Silvers <chuq@chuq.com>
List: port-sparc
Date: 02/08/2000 23:03:23
ok this does affect things somewhat:

3 sparc1:~> objdump -h /netbsd

/netbsd:     file format elf32-sparc

Sections:
Idx Name          Size      VMA       LMA       File off  Algn
  0 .text         001850d8  f0004000  f0004000  00000074  2**2
                  CONTENTS, ALLOC, LOAD, READONLY, CODE
  1 .rodata       000245b2  f01890d8  f01890d8  0018514c  2**3
                  CONTENTS, ALLOC, LOAD, READONLY, DATA
  2 .data         00019de8  f01bd690  f01bd690  001a9700  2**3
                  CONTENTS, ALLOC, LOAD, DATA
  3 .bss          0002a638  f01d7480  f01d7480  001c34f0  2**4
                  ALLOC
  4 .comment      00005d3e  00000000  00000000  001c34f0  2**0
                  CONTENTS, READONLY
  5 .ident        00000115  00005d3e  00005d3e  001c922e  2**0
                  CONTENTS, READONLY

so now the alignment is less, but I'd think it should be 8 rather than 16.
none of the individual .o files have a bss alignment greater than 8.
still fishy.

also, svr4 emul is still broken after this fix.
thanks for trying, tho.

-Chuck



On Mon, Feb 07, 2000 at 01:29:16PM +0100, Klaus Klein wrote:
> Todd Whitesel <toddpw@best.com> writes:
> 
> > > Huh?  Alignment directives (in both .align and .common) on the SPARC
> > > aren't logarithmic, neither in ELF nor (unlike on the x86) a.out
> > > toolchains.
> > 
> > Somebody needs to tell the sparc assembler then...
> 
> That's fairly simple, once you look at it.  Whenever a .common
> directive with an alignment parameter is processed, the gas updates
> the alignment requirements of the bss section as well via
> record_alignment().  That interface, however, takes a logarithmic
> argument (as does frag_align()).
> 
> I've committed a fix; check out tc-sparc rev. 1.4.