From patchwork Tue Sep 1 02:33:10 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matt Turner X-Patchwork-Id: 142572 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from vm01.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 01F2E4BA9020 for ; Tue, 1 Sep 2026 02:36:18 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 01F2E4BA9020 Authentication-Results: sourceware.org; dkim=pass (2048-bit key, unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20251104 header.b=AME+LqCc X-Original-To: binutils@sourceware.org Delivered-To: binutils@sourceware.org Received: from mail-yw1-x1136.google.com (mail-yw1-x1136.google.com [IPv6:2607:f8b0:4864:20::1136]) by sourceware.org (Postfix) with ESMTPS id 7A18C4BA7995 for ; Tue, 1 Sep 2026 02:33:27 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 7A18C4BA7995 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gmail.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 7A18C4BA7995 Authentication-Results: sourceware.org; arc=none smtp.remote-ip=2607:f8b0:4864:20::1136 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1788230007; cv=none; b=eLD+YxN07nw1Zba2GY1blDyITHJ8dNdZVd5R/vok8klSDePcw4h6/LJLiXxPeEVPR4pEgkV3S3zqQaHk5tdSqucbwgqOaPId0MFr/PfF3f38aJ6nHda03dMeMUK0fdhnHOZeCH+/e5HJVUW72w1Aw30onIpXOfbvTKAnU8IHgoE= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1788230007; c=relaxed/simple; bh=UNbL3tYBh8qWtNERXxX1rsSNgh7NswKfWAnfe7DmHuM=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=ojOAyaWU7BndrZEpVRCKVM5STyEdqqnNQhk36FV7CP6Wdbfs3zFbK9vzmL3c9S2wYK31AGfhsrgf9BCdHdr+OWOPcr2YvAI03tK08AvQmIfusIF/EVe+ooE3u1buW3UuG7oNYMmEb645Vhk0KCp4NJGlZq0RojKixSd6ygQT9hk= ARC-Authentication-Results: i=1; sourceware.org; dkim=pass (2048-bit key, unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20251104 header.b=AME+LqCc DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 7A18C4BA7995 Received: by mail-yw1-x1136.google.com with SMTP id 00721157ae682-836c8bde2dcso42111387b3.0 for ; Mon, 31 Aug 2026 19:33:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1788230007; x=1788834807; darn=sourceware.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to:content-type; bh=jgS9qvhOkM+OETDeAOIr2+3kAYXxHuwdJLulROdIzLI=; b=AME+LqCcgkBXBsrzMdVyftXxq+zwDreSqJ/nu37P2GR8wlLHAtcWDfq0MMKPcDIbG+ QJtNLe+uR5bSKwkCzCrW2B8sX1D3mLByWq7jqgzgw90f9Uac6T89gekv6qw+tNBxkW45 +fnulhU0o7GU6Io9Ir+vHN8CS18gVlv3iWXVMq9s0uz2Z1U75lRrbJODHwiUfmsfEURi rJHpasoYbReAdbkYMeaJCnvsmlHaCaOanRHk6KHZb+O0kpEDGFmCnnZnXfWjZs43Y8Mk b0u0Lnk4D0si/ltwiaMYwNOt8H/tGcjQ9yR8voMrmHwDeGcBYxTv+ZMJ2RzUkDQVvxq7 kMtw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1788230007; x=1788834807; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to:content-type; bh=jgS9qvhOkM+OETDeAOIr2+3kAYXxHuwdJLulROdIzLI=; b=WrgWfmNVSA0ucXks+SAz4sZPR+fdS5pgcEly6uCzw5URLLF6TvjCCo1KVo1LPpW57k Sx8FCrnm5JhjOCHf0tBgyuhmYjfKagLV7pkMsuaQ3F2YUtLu5BZOC9plnx4ibFtO84Yg PdMFpkTnb882AGhX2QD7TaQcj83xSO8Lut9rm3HahhlVHJO0oJwRQ7vBXzUePBINOZMG niKauDXwvSyeT3K6P3ibijeqztUuGN/OUzMO23C7FBErj47qyD9IXBBXKif5E1k7XRSB c4J5PjQtKNxXEcUFSQnjSKYpWoYtGz7jx0x7tUK04eGWDmoUGH+qs7aRilX0o5QHfy+0 1NVw== X-Gm-Message-State: AFuF++kvnbfTGaI8ZAMPfdJdd2t+WlrxfynTpjccu0zyZ7LTVB7zCmBo JMrhTzRz2LPtI0jzSlucrCLPJD7UJTSyjJ5l3VDe3NMPHVXAiMLMONVRTLddIQ== X-Gm-Gg: AYBFou0hotifI6+Z9iOtgb3HYyUADi4jeG2HEBhB8wVAtpKkLcecYbeFStPjnza7BY9 +wp6yDjjbJEKHxyTOoL8Hpe0jihDMxaV7jCfXQdlmdciVx1N/qMGunxMXTkNAWCMzB4u0PI2LUZ DXeI8n3seLe9KVUnX6gb7ggZTazI4tsHH79LF9tSt08VxFoIM+CZfi6FSeULJnqW7rZ29XeSaCd 8NYZRpe/MJhbPYBv/jwCJxgTiIimo11kfAPv+EJMfcGcNXvf8UqrikBzALhyqc1u9WPbiblF7C5 tdbV2Fapb+GOqR8L7uI4FcgrE3W/EVYFMxayCfejWjsdjPls6Ec76AdZam+VZiVGy6haJ0v21qC zavfitL5lPthYGyl6I+r8nsIPN4QeB/RrPnSfMcor1iRWmvqXXAjPypBi5uSSrv2LtWFqB3qnOA u/mpJWHX74O4Sx4HhGBv112PlQ5hYmpaC0am6p2ICWJqNQTn3pWPzqKcrzEU5v1qdPKqBCHmSRk FzNnd3sSNUAy8NRNoc3luknvxLzftwGf7bHTCIw X-Received: by 2002:a05:690c:4513:b0:80f:d844:779c with SMTP id 00721157ae682-85d6b275a86mr127974667b3.22.1788230006682; Mon, 31 Aug 2026 19:33:26 -0700 (PDT) Received: from localhost (107-220-129-194.lightspeed.chrlnc.sbcglobal.net. [107.220.129.194]) by smtp.gmail.com with ESMTPSA id 00721157ae682-8646265eb15sm37946067b3.25.2026.08.31.19.33.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 31 Aug 2026 19:33:25 -0700 (PDT) From: Matt Turner To: binutils@sourceware.org Cc: Magnus Lindholm , Alan Modra , Matt Turner Subject: [PATCH 03/11] alpha: allocate R_ALPHA_IRELATIVE Date: Mon, 31 Aug 2026 22:33:10 -0400 Message-ID: <20260901023318.3503991-4-mattst88@gmail.com> X-Mailer: git-send-email 2.54.0 In-Reply-To: <20260901023318.3503991-1-mattst88@gmail.com> References: <20260901023318.3503991-1-mattst88@gmail.com> MIME-Version: 1.0 X-Spam-Status: No, score=-11.2 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_ENVFROM_END_DIGIT, FREEMAIL_FROM, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP shortcircuit=no autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on sourceware.org X-BeenThere: binutils@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Binutils mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: binutils-bounces~patchwork=sourceware.org@sourceware.org R_ALPHA_IRELATIVE is the dynamic relocation that runs an IFUNC's resolver and stores the address it returns, applied by the dynamic linker or, in a static executable, by libc's startup code. Alpha had no number for it. Take 42, the first free number after R_ALPHA_TPREL16. The number is being claimed here and in the matching glibc submission; nothing else uses it, and no dynamic linker implements the relocation yet. glibc's elf/elf.h carries its own copy of these definitions, so the two have to be kept in sync. This adds only the number, the howto, the entry in the BFD reloc map that every other target with an IRELATIVE has, and the reloc class. The linker support that produces the relocation follows. --- bfd/elf64-alpha.c | 19 +++++++++++++++++++ include/elf/alpha.h | 2 ++ 2 files changed, 21 insertions(+) diff --git ./bfd/elf64-alpha.c ./bfd/elf64-alpha.c index a97acdc41de..86a59ba0937 100644 --- ./bfd/elf64-alpha.c +++ ./bfd/elf64-alpha.c @@ -1020,6 +1020,22 @@ static reloc_howto_type elf64_alpha_howto_table[] = 0xffff, /* src_mask */ 0xffff, /* dst_mask */ false), /* pcrel_offset */ + + /* A dynamic relocation to set a 64-bit field to the value returned by + the resolver whose address is the addend. */ + HOWTO (R_ALPHA_IRELATIVE, + 0, + 0, + 0, + false, + 0, + complain_overflow_dont, + bfd_elf_generic_reloc, + "IRELATIVE", + false, + 0, + 0, + true), }; /* A mapping from BFD reloc types to Alpha ELF reloc types. */ @@ -1062,6 +1078,7 @@ static const struct elf_reloc_map elf64_alpha_reloc_map[] = {BFD_RELOC_ALPHA_TPREL_HI16, R_ALPHA_TPRELHI}, {BFD_RELOC_ALPHA_TPREL_LO16, R_ALPHA_TPRELLO}, {BFD_RELOC_ALPHA_TPREL16, R_ALPHA_TPREL16}, + {BFD_RELOC_IRELATIVE, R_ALPHA_IRELATIVE}, }; /* Given a BFD reloc type, return a HOWTO structure. */ @@ -5310,6 +5327,8 @@ elf64_alpha_reloc_type_class (const struct bfd_link_info *info ATTRIBUTE_UNUSED, return reloc_class_plt; case R_ALPHA_COPY: return reloc_class_copy; + case R_ALPHA_IRELATIVE: + return reloc_class_ifunc; default: return reloc_class_normal; } diff --git ./include/elf/alpha.h ./include/elf/alpha.h index 9b7b4cfe16a..f7a0f040508 100644 --- ./include/elf/alpha.h +++ ./include/elf/alpha.h @@ -118,6 +118,8 @@ START_RELOC_NUMBERS (elf_alpha_reloc_type) RELOC_NUMBER (R_ALPHA_TPRELLO, 40) RELOC_NUMBER (R_ALPHA_TPREL16, 41) + RELOC_NUMBER (R_ALPHA_IRELATIVE, 42) + END_RELOC_NUMBERS (R_ALPHA_max) #define LITUSE_ALPHA_ADDR 0