On Fri, Apr 15, 2005 at 12:18:54PM -0700, Mike Stump wrote:
> On Friday, April 15, 2005, at 09:01  AM, Andreas Krebbel wrote:
> >on S/390 we have currently a plenty of testsuite failures
> >due to inlining effects.
> >
> >ld complains about testcases which try to link two files containing 
> >the same function in .gnu.linkonce sections but with different code 
> >sizes.
> 
> This is a linker bug, fix it, then come back.  If you're confused, try 
> porting GNU ld and using it, or take a look at bfd/elflink.c, under 
> SEC_LINK_DUPLICATES_DISCARD v SEC_LINK_DUPLICATES_SAME_SIZE.

Agreed.  At first I was inclined to think otherwise, but then I realized
that we could also get different sizes by linking together code produced
by different compiler versions, or at different optimization levels,
and it certainly must be supported that -00 code can be linked with -O2
code.

So yes, the linker should just shut up and pick one version.  Consistency
of inlining might be an issue, but it's a red herring in this case.  There
are too many other circumstances that could yield different sizes.

Reply via email to