From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 19093 invoked by alias); 14 Mar 2011 16:28:26 -0000 Received: (qmail 19064 invoked by uid 22791); 14 Mar 2011 16:28:23 -0000 X-SWARE-Spam-Status: No, hits=-2.3 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_LOW X-Spam-Check-By: sourceware.org Received: from mail-ww0-f43.google.com (HELO mail-ww0-f43.google.com) (74.125.82.43) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Mon, 14 Mar 2011 16:28:19 +0000 Received: by wwb17 with SMTP id 17so4450049wwb.12 for ; Mon, 14 Mar 2011 09:28:16 -0700 (PDT) Received: by 10.216.58.207 with SMTP id q57mr9441192wec.63.1300120096828; Mon, 14 Mar 2011 09:28:16 -0700 (PDT) Received: from richards-thinkpad (gbibp9ph1--blueice2n1.emea.ibm.com [195.212.29.75]) by mx.google.com with ESMTPS id z50sm1203304weq.23.2011.03.14.09.28.14 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 14 Mar 2011 09:28:15 -0700 (PDT) From: Richard Sandiford To: Cary Coutant Mail-Followup-To: Cary Coutant ,Binutils , Ian Lance Taylor , Paul Pluzhnikov , Doug Kwan , David Miller , Andreas Schwab , richard.sandiford@linaro.org Cc: Binutils , Ian Lance Taylor , Paul Pluzhnikov , Doug Kwan , David Miller , Andreas Schwab Subject: Re: [RFC] [gold] Simplify relocation strategy logic References: Date: Mon, 14 Mar 2011 16:28:00 -0000 In-Reply-To: (Cary Coutant's message of "Mon, 14 Mar 2011 08:58:33 -0700") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable 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: 2011-03/txt/msg00282.txt.bz2 Cary Coutant writes: >> I don't believe this is correct. =C2=A0ABSOLUTE_REF is defined as: >> >> =C2=A0 =C2=A0// A reference to the symbol's absolute address. =C2=A0This= includes >> =C2=A0 =C2=A0// references that cause an absolute address to be stored i= n the GOT. >> =C2=A0 =C2=A0ABSOLUTE_REF =3D 1, >> >> and the final symbol reference (by the GOT entry) is absolute >> in all these cases. =C2=A0("Absolute in GOT" was supposed to mean >> "an absolute reference _in_ the global offset table", not "to".) >> Whether the reference to the GOT entry itself is absolute, relative >> to the GP, or relative to the PC, isn't modelled by these flags. >> >> Does the patch rely on this, or was it just something you noticed >> by inspection? > > My understanding of the ABI is that R_X86_64_GOTPCREL is a pc-relative > relocation to the GOT entry, and R_X86_64_GOTPLT64 is an absolute > reference to a GOT entry. In both cases, I believe the GOT entry > itself is expected to contain an absolute address. Right. > I rely on these flags modeling the reference to the GOT entry, not the > GOT entry itself, In that case, you're changing the meaning of the flags, so I think you'll need to adjust all other ports as well the comment. The current code really was written to the current definition of ABSOLUTE_REF. Richard