section() handling changed (or a bug was introduced)?

Mariusz Mazur
Wed Oct 20 13:03:00 GMT 2004

On Âśroda 20 paÂździernik 2004 00:24, Daniel Jacobowitz wrote:
> > [builder2@storm builder2]$ cat test.s
> >         .file   "test.c"
> > .globl __sparc32_atomic_locks
> >         .section        .bss,"awG",@nobits,.__sparc32_atomic_locks,comdat
> >         .align 32
> >         .type   __sparc32_atomic_locks, @object
> >         .size   __sparc32_atomic_locks, 64
> > __sparc32_atomic_locks:
> >         .zero   64
> >         .section        .note.GNU-stack,"",@progbits
> >         .ident  "GCC: (GNU) 3.4.3 20041008 (prerelease) (PLD Linux)"
> >
> >
> > Obviously the second example is broken. Is this some kind of changed
> > syntax (haven't found anything about it with google) or just a plain bug?
> Two things:
>   - While changing a user-specified section name is a little dubious,
> i.e. probably no one thought about it, the second sample looks right to
> me.  It crashes binutils 2.15 but is accepted by binutils HEAD.  Ew.

The second example causes creation of 'global' objects in symbols table in 
object files (.bss[.__sparc32_atomic_locks]) which in turn means that these 
global objects conflict when linking. And it's obvious that they shouldn't 
(and glibc depends on the fact, that those object remain local).

>   - Does PLD Linux have GCC patches?  Cause COMDAT support has not been
> checked in on the 3.4 branch, far as I can see.

Excerpt from gcc.spec changelog:

Revision  2004/08/07 00:49:17  qboosh
- added pr16276 patch (fixes libstdc++ linking on ia64;
  needs binutils with COMDAT support)

I'll rebuild without that patch and check. It's probably the cause, but I need 
that stuff working on all archs (ia64 included), so the author of that patch 
will probably be hearing from me :)

In the year eighty five ten
God is gonna shake his mighty head
He'll either say,
"I'm pleased where man has been"
Or tear it down, and start again

More information about the Gcc mailing list