This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
Re: PATCH: Multiple sections with same name don't work
Alan Modra <amodra@bigpond.net.au> writes:
> On Sat, May 01, 2004 at 12:06:18AM -0700, H. J. Lu wrote:
>> On Fri, Apr 30, 2004 at 10:50:08PM -0700, H. J. Lu wrote:
>> > On Fri, Apr 30, 2004 at 10:12:01PM -0700, Zack Weinberg wrote:
>> > > Alan Modra <amodra@bigpond.net.au> writes:
>> > > > The real question is: Do we need multiple sections of the same name
>> > > > in assembly files? I don't think we do.
>> > >
>> > > I need them in order to generate COMDAT sections compatible with the
>> > > HPUX linker. gcc might emit e.g.
>> > >
>> > > .section .text
>> > > # non-COMDAT code ...
>> > >
>> > > .section .text,"G",symbol_name,comdat
>> > > # code for symbol_name ...
>
> Hmm, it wouldn't be much harder to use
>
> .section .text.symbol_name,"G",symbol_name,comdat
> # code for symbol_name ...
That may not work. Unfortunately, the HPUX linker's COMDAT-group
support is only partially documented, and subtly incompatible with the
standard ELF SHT_GROUP notion. I am having to work things out by
reverse engineering what aCC does -- and it uses multiple sections
with the same name.
zw