This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] PR32219, weak hidden reference segfault [PING^2]
- From: Mike Stump <mrs at mrs dot kithrup dot com>
- To: Chung-Lin Tang <cltang at codesourcery dot com>
- Cc: Diego Novillo <dnovillo at google dot com>, Bernhard Reutner-Fischer <rep dot dot dot nop at gmail dot com>, gcc-patches <gcc-patches at gcc dot gnu dot org>, Nathan Sidwell <nathan_sidwell at mentor dot com>, rdsandiford at googlemail dot com, Richard Günther <rguenther at suse dot de>, Jeff Law <law at redhat dot com>
- Date: Mon, 5 Aug 2013 07:06:05 -0700
- Subject: Re: [PATCH] PR32219, weak hidden reference segfault [PING^2]
- References: <518B71DA dot 1030302 at codesourcery dot com> <878v3nt91c dot fsf at talisman dot default> <51935F65 dot 4000803 at codesourcery dot com> <87hai4a1ce dot fsf at sandifor-thinkpad dot stglab dot manchester dot uk dot ibm dot com> <51A85B99 dot 1040102 at codesourcery dot com> <CAC1BbcRkA52ytKsSD3xm2GdgVhSQ+s3vfT3a=gvdCheGZ0LvhQ at mail dot gmail dot com> <51C2A8B4 dot 9020302 at codesourcery dot com> <51E26AA1 dot 7070808 at codesourcery dot com> <CAD_=9DRF6aD=5Rm=V4F3jMYuGV46YCD4LEqZfvHXGDCKvbjgrQ at mail dot gmail dot com> <51FE6FDC dot 2090500 at codesourcery dot com>
On Aug 4, 2013, at 8:14 AM, Chung-Lin Tang <cltang@codesourcery.com> wrote:
> On 13/7/15 1:43 AM, Diego Novillo wrote:
>> Could you please repost the patch with its description? This thread
>> is sufficiently old and noisy that I'm not even sure what the patch
>> does nor why.
>
> Taking the same example in my first post:
>
> Under -fPIC, the code in rtlanal.c:nonzero_address_p() does not properly
> recognize the "PIC-reg + <constant>" form of load as a weak symbol; it
> returns 'true' immediately after seeing the pic-reg indexing, and does
> not test the wrapped symbol for DECL_WEAK.
So, I can't help but think that others would say that looking into an unspec is by nature, the wrong way to do it, unless that code is in the port.
I think the followup from Bernhard points to a better solution, though the wording in the comment was objectionable. Merely say that the symbol, if weak and not defined, is then not local.