From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pl1-x636.google.com (mail-pl1-x636.google.com [IPv6:2607:f8b0:4864:20::636]) by sourceware.org (Postfix) with ESMTPS id 25B0E3858D1E for ; Tue, 8 Feb 2022 13:03:25 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 25B0E3858D1E Received: by mail-pl1-x636.google.com with SMTP id k17so13826589plk.0 for ; Tue, 08 Feb 2022 05:03:25 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=CsQgVcZWYdi2udE5VxXmtRikFUbCWiCrD9rSnWyPaFU=; b=VGrG9xAad8YuAYAi3Ku9FTv7dy4XC+16xwlalKlywjJAdsg9FnIMP1kfqigbKEziVy ru/Xm9jq4rgiXqhxibqeu2/9uakAvvbYfDQ8sskFBCNfGaEo1OBWqkkAq3AlnGvK/hjN 2E+GibyKzNKIlXNEKyCKw8FEShDdS7d5Y7pVOKwpR0nwLNuV77jDtAVCEF5NKpdZn9fF aQ4DCDA2pWwdsvtXAfNqcIsUyB/KfAc0aKpgJST5r34tJPdBv06Xsl0Nd4uE3ieRWyEz KxdwA93DSqEKzsupA8xNSkcrCYElEgW0iJIeRAOWlDf0vN1HUYyS52iu2B3ku+9JnBjU kkSQ== X-Gm-Message-State: AOAM532JDtY5yf+6JMBXcrb7CxTHWPMlh2qOCCvWnGawX5hrfb0HbCd4 B1wD4/yCdiHc0pVBqBExAEc9xVjcsUB1BKO0lCYZWmYz X-Google-Smtp-Source: ABdhPJxNQ5iaLIRPymlxgN8D0G+bVU4NDqq2RtogGZ+mYpKG7Vf3EbB6kGnqPRw4PDNEE+AqGd87Q92RE25YnzhMfJM= X-Received: by 2002:a17:902:e84f:: with SMTP id t15mr4261484plg.102.1644325403722; Tue, 08 Feb 2022 05:03:23 -0800 (PST) MIME-Version: 1.0 References: <20220208000322.4108601-1-hjl.tools@gmail.com> <4785d6f1-cd0c-2ad4-9a13-6a05f6557b69@suse.com> In-Reply-To: <4785d6f1-cd0c-2ad4-9a13-6a05f6557b69@suse.com> From: "H.J. Lu" Date: Tue, 8 Feb 2022 05:02:47 -0800 Message-ID: Subject: Re: [PATCH] i386: Allow GOT32 relocations against ABS symbols To: Jan Beulich Cc: Binutils Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-3020.9 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org X-BeenThere: binutils@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Binutils mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 08 Feb 2022 13:03:31 -0000 On Tue, Feb 8, 2022 at 12:37 AM Jan Beulich wrote: > > On 08.02.2022 01:03, H.J. Lu via Binutils wrote: > > GOT32 relocations are allowed since absolute value + addend is stored in > > the GOT slot. > > Before permitting this and with you specifically mentioning addends > here, I think it needs to be clarified what ... > > > --- /dev/null > > +++ b/ld/testsuite/ld-i386/pr28870.s > > @@ -0,0 +1,6 @@ > > + .text > > + .globl _start > > +_start: > > + addl foo@GOT(%ebx), %eax > > + cmpl $0, foo@GOT(%ebx) > > +foo = 2 > > ... missing (here) variants thereof actually mean (and whether the use > of addends actually works as intended): > > mov $v@got+3, %eax # bogus, meaningless operand > mov $(v+3)@got, %eax # wrong (gets treated same as above) > > Comments are my own, preliminary judgement. GOT relocations should only be used as @got or @got(%reg). Other variants are undefined. -- H.J.