From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 585 invoked by alias); 26 Mar 2009 00:26:33 -0000 Received: (qmail 571 invoked by uid 22791); 26 Mar 2009 00:26:32 -0000 X-SWARE-Spam-Status: No, hits=-1.5 required=5.0 tests=AWL,BAYES_00,SARE_MSGID_LONG40,SPF_PASS X-Spam-Check-By: sourceware.org Received: from smtp-out.google.com (HELO smtp-out.google.com) (216.239.45.13) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 26 Mar 2009 00:26:28 +0000 Received: from spaceape7.eur.corp.google.com (spaceape7.eur.corp.google.com [172.28.16.141]) by smtp-out.google.com with ESMTP id n2Q0QPpq010741 for ; Wed, 25 Mar 2009 17:26:25 -0700 Received: from yw-out-2324.google.com (ywj3.prod.google.com [10.192.10.3]) by spaceape7.eur.corp.google.com with ESMTP id n2Q0QNuY017507 for ; Wed, 25 Mar 2009 17:26:23 -0700 Received: by yw-out-2324.google.com with SMTP id 3so198319ywj.69 for ; Wed, 25 Mar 2009 17:26:22 -0700 (PDT) MIME-Version: 1.0 Received: by 10.231.19.72 with SMTP id z8mr47612iba.42.1238027182876; Wed, 25 Mar 2009 17:26:22 -0700 (PDT) In-Reply-To: <20090325200743.D15751@dair.pair.com> References: <20090325200743.D15751@dair.pair.com> Date: Thu, 26 Mar 2009 00:26:00 -0000 Message-ID: Subject: Re: [gold][patch] Fix non-PIC warning to print only when building position-independent output From: Cary Coutant To: Hans-Peter Nilsson Cc: Binutils Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-System-Of-Record: true X-IsSubscribed: yes Mailing-List: contact binutils-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: binutils-owner@sourceware.org X-SW-Source: 2009-03/txt/msg00466.txt.bz2 >> If we ever do hit this case in a >> non-position-independent link, however, I hope it'll be the compiler's >> fault, and we shouldn't print a message that implies that -fPIC is >> actually required. (Maybe we should print something instead about a >> possible bug in the compiler or assembly code?) > > IMHO don't just hint at a gcc bug: missing -fPIC is much too > common. =A0Or if that's not applicable here, maybe the user didn't > use the correct linker option? If a missing -fPIC really is the problem, we will still print that. If you're building a non-position-independent executable, however, you shouldn't be told to recompile the code with -fPIC, because that's not supposed to be required for code in an executable. Instead, it points to a problem either with hand-written assembly code (most likely, I think), or with the compiler, or with the linker. If the only possibility were a linker bug, I could just put an assert here and let the linker die: + gold_assert(parameters->options().output_is_position_independent()); + object->error(_("requires unsupported dynamic reloc; " + "recompile with -fPIC")); + this->issued_unsupp_reloc_error_ =3D true; I don't think that's the only (or even the most likely) possibility, though. -cary