This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: PR 161/251 patch causing massive link time regression
- From: "H. J. Lu" <hjl at lucon dot org>
- To: Jakub Jelinek <jakub at redhat dot com>
- Cc: binutils at sources dot redhat dot com, gcc at gcc dot gnu dot org
- Date: Thu, 14 Oct 2004 11:48:47 -0700
- Subject: Re: PR 161/251 patch causing massive link time regression
- References: <20041013203909.GT30497@sunsite.ms.mff.cuni.cz> <20041014002107.GA26798@lucon.org> <20041014125626.GY30497@sunsite.ms.mff.cuni.cz>
On Thu, Oct 14, 2004 at 02:56:26PM +0200, Jakub Jelinek wrote:
> On Wed, Oct 13, 2004 at 05:21:07PM -0700, H. J. Lu wrote:
> > It should help. We can also require the single member comdat group,
> > which may match a linkonce section, should have the group sigature
> > the same as the section name of the linkonce section. We don't have
> > to check symbols between 2 sections.
> >
> > BTW, the problem my patch tries to fix is
> >
> > .section .gnu.linkonce.t.__i686.get_pc_thunk.bx,"axG",@progbits,__i686.get_pc_thunk.bx,comdat
> >
> > vs.
> >
> > .section .gnu.linkonce.t.__i686.get_pc_thunk.bx,"ax",@progbits
> >
> > linker should treat them the same. If gcc can generate
> >
> > .section .gnu.linkonce.t.__i686.get_pc_thunk.bx,"axG",@progbits,.gnu.linkonce.t.__i686.get_pc_thunk.bx,comdat
> >
> > it will help linker a lot.
>
> Would the following patch be enough?
>
> E.g. following combinations would work:
> .section .gnu.linkonce.t.__i686.get_pc_thunk.bx,"axG",@progbits,__i686.get_pc_thunk.bx,comdat
> .section .gnu.linkonce.t.__i686.get_pc_thunk.bx,"ax",@progbits
>
> .section .gnu.linkonce.t.__i686.get_pc_thunk.bx,"axG",@progbits,.gnu.linkonce.t.__i686.get_pc_thunk.bx,comdat
> .section .gnu.linkonce.t.__i686.get_pc_thunk.bx,"ax",@progbits
>
> .section .text,"axG",@progbits,__i686.get_pc_thunk.bx,comdat
> .section .gnu.linkonce.t.__i686.get_pc_thunk.bx,"ax",@progbits
>
> .section .text,"axG",@progbits,.gnu.linkonce.t.__i686.get_pc_thunk.bx,comdat
> .section .gnu.linkonce.t.__i686.get_pc_thunk.bx,"ax",@progbits
>
> though your testcase in PR 161 will not work (the comdat group is there
> .__i686.get_pc_thunk.bx, not sure why the dot at the begining).
It is OK. We can put restriction on group signature when it should
match a linkonce section.
> At least the intent of the patch (unless I goofed up) is doing exactly what
> linker did without this patch, but only try to match sections that have the
> same base section name (resp. comdat group name), where base section name
> is section name with ^\.gnu\.linkonce\.[^.]*\. prefix if present stripped.
>
It looks good to me. How much speed up did yot get with it?
H.J.