From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-oa1-x32.google.com (mail-oa1-x32.google.com [IPv6:2001:4860:4864:20::32]) by sourceware.org (Postfix) with ESMTPS id BB87E3858D28 for ; Thu, 5 Jan 2023 17:03:49 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org BB87E3858D28 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-oa1-x32.google.com with SMTP id 586e51a60fabf-1441d7d40c6so43561662fac.8 for ; Thu, 05 Jan 2023 09:03:49 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=wy6IM45gOs7ddalpsWaB3Fb0dN5qVDtbJANNS8sCGPk=; b=MMv5qGbiaV6jlYr3g+tx4lF5A+E8r4Kaip1+f2RA2V5stFOLJkf1AF40U1oV76eY6U E2wJ5wM+pNLj5daw4UvmaecipUBAVmPH2KtVFkt6RFE27GDH32zHTeIKpDb2Ib7tiflr VepvB8SPOYUC9/cZttHkLxI3TPfPezT0OTXxMSwGgm0gHAKETfSLboHzLvGgkCuJFjZI Vi0zurRK/DpRfEWe0mE2xMi5p6yUID+tK8QvckJ2xWnbiQwCaaH1Zs9jawynWln1Qf6W IeNo2fJ6eDnNHou8q69DCG1Ac/oeiysPlcEqdyRgd4IRZKZpvbeM6XKxna5P8VNERsiG XI2Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=wy6IM45gOs7ddalpsWaB3Fb0dN5qVDtbJANNS8sCGPk=; b=NFDGI7cyZgi/Kud10T3iVgzXm7E3mJg8ou+ywzSkbN5+BdfESI3sUF+GA/SYbzCd43 QGPQUagRdxnc49AMKO+f+br3mj+0PEY+bdPGaz5r9AbdxNPOubfr2VsmEYe0GBeOLKT8 YjslWMx9aQJaR9AqxUJJzFkZ3sCFjGpxet3NijKdB2loySk4VrTQN5eED8my0eFuGGUl PptWA7AAwnsEU60HFJ0of4wsCJ6vQF8qVG5QvBr64E223kg/dlxw0DNRuGlbTUOy+f1y cldME8pfUnX4Cj7km2UdmFwttLMStBtLm4JfmSOXYm+FKpINOf4EoY9u6mVNJxPUnIik QT5g== X-Gm-Message-State: AFqh2kqChcg7B7lbz6E0ZQOKvQ8tvPWLlu8G9blySRvwfCbDfZ4DA8mG JFhyQQ0+i/EY4+pqD1JCPE4f2voNnWUY1n4vEnYbmWza X-Google-Smtp-Source: AMrXdXuqcBolhKAyXqpaIcZ5MrMLFHnbwmgCp+ugvzCbCM8H5LfJ8evKC09u0pjcW3QeS0YmQBXbEKpt0FUHZVN+s7c= X-Received: by 2002:a05:6870:c07:b0:150:ccf2:326b with SMTP id le7-20020a0568700c0700b00150ccf2326bmr909788oab.266.1672938228779; Thu, 05 Jan 2023 09:03:48 -0800 (PST) MIME-Version: 1.0 References: <20230104191414.149668-1-hjl.tools@gmail.com> <707373e1-01e6-21ea-c407-db61da912e22@suse.com> <253e0337-5c05-5e56-de71-6ff890502af3@suse.com> In-Reply-To: From: "H.J. Lu" Date: Thu, 5 Jan 2023 09:03:12 -0800 Message-ID: Subject: Re: [PATCH] x86: Remove duplicated I386_PCREL_TYPE_P/X86_64_PCREL_TYPE_P To: Jan Beulich Cc: binutils@sourceware.org Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-3015.0 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,RCVD_IN_SBL_CSS,SPF_HELO_NONE,SPF_PASS,TXREP autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: On Thu, Jan 5, 2023 at 9:01 AM Jan Beulich wrote: > > On 05.01.2023 17:55, H.J. Lu wrote: > > On Thu, Jan 5, 2023 at 8:52 AM Jan Beulich wrote: > >> On 05.01.2023 17:50, H.J. Lu wrote: > >>> On Wed, Jan 4, 2023 at 11:42 PM Jan Beulich wrote: > >>>> On 04.01.2023 20:14, H.J. Lu via Binutils wrote: > >>>>> I386_PCREL_TYPE_P and X86_64_PCREL_TYPE_P are defined twice. Remove > >>>>> the duplications. > >>>> > >>>> I recall noticing this as well, quite some time back, but I didn't feel > >>>> like touching it because I was puzzled by ... > >>>> > >>>>> --- a/bfd/elfxx-x86.h > >>>>> +++ b/bfd/elfxx-x86.h > >>>>> @@ -97,13 +97,6 @@ > >>>>> #define PLT_FDE_START_OFFSET 4 + PLT_CIE_LENGTH + 8 > >>>>> #define PLT_FDE_LEN_OFFSET 4 + PLT_CIE_LENGTH + 12 > >>>>> > >>>>> -#define I386_PCREL_TYPE_P(TYPE) ((TYPE) == R_386_PC32) > >>>> > >>>> ... this not including PC8 and PC16 when ... > >>> > >>> This is I386_PCREL_TYPE_P. > >>> > >>>>> -#define X86_64_PCREL_TYPE_P(TYPE) \ > >>>>> - ((TYPE) == R_X86_64_PC8 \ > >>>>> - || (TYPE) == R_X86_64_PC16 \ > >>>>> - || (TYPE) == R_X86_64_PC32 \ > >>>>> - || (TYPE) == R_X86_64_PC64) > >>>> > >>>> ... this does. > >>> > >>> This is X86_64_PCREL_TYPE_P, not I386_PCREL_TYPE_P. > >>> > >>>> Jan > >>> > >>> The current ones have > >>> > >>> #define X86_64_PCREL_TYPE_P(TYPE) \ > >>> ((TYPE) == R_X86_64_PC8 \ > >>> || (TYPE) == R_X86_64_PC16 \ > >>> || (TYPE) == R_X86_64_PC32 \ > >>> || (TYPE) == R_X86_64_PC64) > >>> #define I386_PCREL_TYPE_P(TYPE) ((TYPE) == R_386_PC32) > >>> > >>> and the ones I removed are > >>> > >>> -#define I386_PCREL_TYPE_P(TYPE) ((TYPE) == R_386_PC32) > >>> -#define X86_64_PCREL_TYPE_P(TYPE) \ > >>> - ((TYPE) == R_X86_64_PC8 \ > >>> - || (TYPE) == R_X86_64_PC16 \ > >>> - || (TYPE) == R_X86_64_PC32 \ > >>> - || (TYPE) == R_X86_64_PC64) > >>> > >>> They are identical. > >> > >> That wasn't the question, though. I really did ask about the 32-bit vs > >> 64-bit difference, which looks suspect to me. > >> > > > > R_386_PC8 and R_386_PC16 were never handled by linker. > > May I then ask why that is (or, worded differently, why the two respective > types are handled for x86-64)? Is this just one of the many inconsistencies > that we have? > I guess so. -- H.J.