From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pf1-x42f.google.com (mail-pf1-x42f.google.com [IPv6:2607:f8b0:4864:20::42f]) by sourceware.org (Postfix) with ESMTPS id 295063857BB1 for ; Thu, 4 Aug 2022 03:37:28 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 295063857BB1 Received: by mail-pf1-x42f.google.com with SMTP id c139so18232729pfc.2 for ; Wed, 03 Aug 2022 20:37:28 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=uwQIGPp0/e22M6irCJ1C9G39iIEdQWbdH5E+ElCG/bE=; b=nx2pCUHdzSj6eDIELJ9r0WbBEciBetOo4qV9pjrg+EKaoRMS2uBiF6KCxW+inLQndU cmh1g+oLYj28L6n6WnRDHy5FVMJgezxBz+ygiZ0nTqIcnW0DTS9qmubrg/9W4DbMPVZX qIvOKBosnd2O8cF8w+IDK5Zyf7ExeoOnneBZjk2jO/8zv1MFcgNzHUtXb/YEU5UFhjWM P0Xl8LPz4QNowQ0WA0VeTTQCA/0DQWEZXiY1cbXfO+B7NwJvmS98YuMWkWAxywLA0OFB ebePRl+jiiQgEtYxf5QXH+Q2k/AqLpaAMHBUalUK3prsvp3jqST75CAXBZgt1Wkmtqwp qSXQ== X-Gm-Message-State: AJIora+5v0b0DyHTDI5659mLbkGZCpIRPaaKEhBzVxnGI2M5jFR67BrL a/Eky5aj8Ew/FwDkHq/ssbw= X-Google-Smtp-Source: AGRyM1tNlj0mcxkTXvKiiYvNZzbMLS4geVowgn5zDCUZkbPbcfiPfI2+mwlCWIK6vi6K26dARew2dQ== X-Received: by 2002:a05:6a00:e8f:b0:528:a1c7:3d00 with SMTP id bo15-20020a056a000e8f00b00528a1c73d00mr28044277pfb.25.1659584247088; Wed, 03 Aug 2022 20:37:27 -0700 (PDT) Received: from squeak.grove.modra.org ([2406:3400:51d:8cc0:364f:8536:bc56:7d7c]) by smtp.gmail.com with ESMTPSA id q14-20020a170902dace00b0016bdea07b9esm2784835plx.190.2022.08.03.20.37.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 03 Aug 2022 20:37:26 -0700 (PDT) Received: by squeak.grove.modra.org (Postfix, from userid 1000) id CE941114005C; Thu, 4 Aug 2022 13:07:23 +0930 (ACST) Date: Thu, 4 Aug 2022 13:07:23 +0930 From: Alan Modra To: "Maciej W. Rozycki" Cc: binutils@sourceware.org Subject: Re: BFD_RELOC_MIPS_16 Message-ID: References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-3035.7 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, GIT_PATCH_0, KAM_NUMSUBJECT, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) 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: Thu, 04 Aug 2022 03:37:29 -0000 On Wed, Aug 03, 2022 at 12:59:09AM +0100, Maciej W. Rozycki wrote: > On Tue, 14 Jun 2022, Alan Modra via Binutils wrote: > > > time. Like BFD_RELOC_8, BFD_RELOC_16 now has no corresponding object > > file relocation, and thus .half, .hword, .short and .dc.w must be > > resolved at assembly time. > > That should be R_MIPS_REL16 AFAICT, reloc #33 according to MIPS NewABI > documentation[1]: > > Name Value Field Symbol Calculation > R_MIPS_REL16 33 V-hw16 any S+A Huh. So R_MIPS_REL16 isn't a pc-relative reloc as the name might indicate. I'll apply the following. * elf64-mips.c (mips_reloc_map): Map BFD_RELOC_16 to R_MIPS_REL16. * elfn32-mips.c (mips_reloc_map): Likewise. diff --git a/bfd/elf64-mips.c b/bfd/elf64-mips.c index 8097e7cd49d..c2c6604ef68 100644 --- a/bfd/elf64-mips.c +++ b/bfd/elf64-mips.c @@ -3684,6 +3684,7 @@ static const struct elf_reloc_map mips_reloc_map[] = { { BFD_RELOC_NONE, R_MIPS_NONE }, { BFD_RELOC_MIPS_16, R_MIPS_16 }, + { BFD_RELOC_16, R_MIPS_REL16 }, { BFD_RELOC_32, R_MIPS_32 }, /* There is no BFD reloc for R_MIPS_REL32. */ { BFD_RELOC_64, R_MIPS_64 }, diff --git a/bfd/elfn32-mips.c b/bfd/elfn32-mips.c index 7cae394bfa0..af984545796 100644 --- a/bfd/elfn32-mips.c +++ b/bfd/elfn32-mips.c @@ -3514,6 +3514,7 @@ static const struct elf_reloc_map mips_reloc_map[] = { { BFD_RELOC_NONE, R_MIPS_NONE }, { BFD_RELOC_MIPS_16, R_MIPS_16 }, + { BFD_RELOC_16, R_MIPS_REL16 }, { BFD_RELOC_32, R_MIPS_32 }, /* There is no BFD reloc for R_MIPS_REL32. */ { BFD_RELOC_CTOR, R_MIPS_32 }, -- Alan Modra Australia Development Lab, IBM