Ali Bahrami <Ali.Bahrami at Sun.COM> writes:

> I assumed that the latest gcc uses SHT_GROUP, but don't actually
> know which version introduces it. So let's find out what your new
> gcc is doing. Take an object built with your new gcc compiler, and do:
> 
>       % elfdump -c | grep linkonce
> 
> If you get any output, then you're not using a compiler with the SHT_GROUP
> stuff, and the fact that you're getting the same link times is not surprising.
> If on the other hand,
> 
>       % elfdump -c | grep GROUP
> 
> produces output, then the new compiler does use the group feature.

I've just checked, and even GCC mainline (to become 4.4.0) doesn't support
SHT_GROUP yet.  This happens for two reasons:

* gcc/configure.ac has those checks:

gcc_GAS_CHECK_FEATURE(COMDAT group support, gcc_cv_as_comdat_group,
 [elf,2,16,0], [--fatal-warnings],
 [.section .text,"axG", at progbits,.foo,comdat])
if test $gcc_cv_as_comdat_group = yes; then
  gcc_cv_as_comdat_group_percent=no
else
 gcc_GAS_CHECK_FEATURE(COMDAT group support, gcc_cv_as_comdat_group_percent,
   [elf,2,16,0], [--fatal-warnings],
   [.section .text,"axG",%progbits,.foo,comdat])
fi

  Due to the use of --fatal-warnings, this can only work with GNU as, Sun
  as would choke on this flag.  Even if GNU as is in use, the version
  currently included in /usr/sfw/bin/gas segfaults on the testcase (at
  least on x86), while gas 2.19 works.

  To make this work with Sun as, we need to know the syntax understood.
  Unfortunately, considerable parts of Sun as syntax are completely
  undocumented ;-(

* Even if the assembler part of the test passed, further down there is

else
  # assume linkers other than GNU ld don't support COMDAT group
  comdat_group=no
fi

  I.e. we either need a feature test for other linkers or (again ;-) hard
  code which O/S versions support SHT_GROUP since their FCS release.

If I can get the necessary information, I can probably get an appropriate
patch into GCC (if not for 4.4.0, which is in regression-only mode right
now and about to branch really soon, than at least for 4.5).

Btw, the patch to support the visibility attribute with Sun ld just went in
for 4.4.0.

        Rainer

-- 
-----------------------------------------------------------------------------
Rainer Orth, Faculty of Technology, Bielefeld University

Reply via email to