get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

GET /api/1.1/patches/2229579/?format=api
HTTP 200 OK
Allow: GET, PUT, PATCH, HEAD, OPTIONS
Content-Type: application/json
Vary: Accept

{
    "id": 2229579,
    "url": "http://patchwork.ozlabs.org/api/1.1/patches/2229579/?format=api",
    "web_url": "http://patchwork.ozlabs.org/project/glibc/patch/20260428134130.2430638-1-adhemerval.zanella@linaro.org/",
    "project": {
        "id": 41,
        "url": "http://patchwork.ozlabs.org/api/1.1/projects/41/?format=api",
        "name": "GNU C Library",
        "link_name": "glibc",
        "list_id": "libc-alpha.sourceware.org",
        "list_email": "libc-alpha@sourceware.org",
        "web_url": "",
        "scm_url": "",
        "webscm_url": ""
    },
    "msgid": "<20260428134130.2430638-1-adhemerval.zanella@linaro.org>",
    "date": "2026-04-28T13:40:47",
    "name": "elf: Defer all IRELATIVE relocations until after PLT setup (BZ 20673)",
    "commit_ref": null,
    "pull_url": null,
    "state": "new",
    "archived": false,
    "hash": "d7c88b6d8223fea25b28367ac7b9b0159a60a437",
    "submitter": {
        "id": 66065,
        "url": "http://patchwork.ozlabs.org/api/1.1/people/66065/?format=api",
        "name": "Adhemerval Zanella",
        "email": "adhemerval.zanella@linaro.org"
    },
    "delegate": null,
    "mbox": "http://patchwork.ozlabs.org/project/glibc/patch/20260428134130.2430638-1-adhemerval.zanella@linaro.org/mbox/",
    "series": [
        {
            "id": 501858,
            "url": "http://patchwork.ozlabs.org/api/1.1/series/501858/?format=api",
            "web_url": "http://patchwork.ozlabs.org/project/glibc/list/?series=501858",
            "date": "2026-04-28T13:40:47",
            "name": "elf: Defer all IRELATIVE relocations until after PLT setup (BZ 20673)",
            "version": 1,
            "mbox": "http://patchwork.ozlabs.org/series/501858/mbox/"
        }
    ],
    "comments": "http://patchwork.ozlabs.org/api/patches/2229579/comments/",
    "check": "pending",
    "checks": "http://patchwork.ozlabs.org/api/patches/2229579/checks/",
    "tags": {},
    "headers": {
        "Return-Path": "<libc-alpha-bounces~incoming=patchwork.ozlabs.org@sourceware.org>",
        "X-Original-To": [
            "incoming@patchwork.ozlabs.org",
            "libc-alpha@sourceware.org"
        ],
        "Delivered-To": [
            "patchwork-incoming@legolas.ozlabs.org",
            "libc-alpha@sourceware.org"
        ],
        "Authentication-Results": [
            "legolas.ozlabs.org;\n\tdkim=pass (2048-bit key;\n unprotected) header.d=linaro.org header.i=@linaro.org header.a=rsa-sha256\n header.s=google header.b=YQlwaO85;\n\tdkim-atps=neutral",
            "legolas.ozlabs.org;\n spf=pass (sender SPF authorized) smtp.mailfrom=sourceware.org\n (client-ip=2620:52:6:3111::32; helo=vm01.sourceware.org;\n envelope-from=libc-alpha-bounces~incoming=patchwork.ozlabs.org@sourceware.org;\n receiver=patchwork.ozlabs.org)",
            "sourceware.org;\n\tdkim=pass (2048-bit key,\n unprotected) header.d=linaro.org header.i=@linaro.org header.a=rsa-sha256\n header.s=google header.b=YQlwaO85",
            "sourceware.org;\n dmarc=pass (p=none dis=none) header.from=linaro.org",
            "sourceware.org; spf=pass smtp.mailfrom=linaro.org",
            "server2.sourceware.org;\n arc=none smtp.remote-ip=2607:f8b0:4864:20::b131"
        ],
        "Received": [
            "from vm01.sourceware.org (vm01.sourceware.org\n [IPv6:2620:52:6:3111::32])\n\t(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n\t key-exchange x25519 server-signature ECDSA (secp384r1) server-digest SHA384)\n\t(No client certificate requested)\n\tby legolas.ozlabs.org (Postfix) with ESMTPS id 4g4hSK3dQwz1yHv\n\tfor <incoming@patchwork.ozlabs.org>; Tue, 28 Apr 2026 23:42:09 +1000 (AEST)",
            "from vm01.sourceware.org (localhost [127.0.0.1])\n\tby sourceware.org (Postfix) with ESMTP id 663E94B920A1\n\tfor <incoming@patchwork.ozlabs.org>; Tue, 28 Apr 2026 13:42:07 +0000 (GMT)",
            "from mail-yx1-xb131.google.com (mail-yx1-xb131.google.com\n [IPv6:2607:f8b0:4864:20::b131])\n by sourceware.org (Postfix) with ESMTPS id 569514BB593A\n for <libc-alpha@sourceware.org>; Tue, 28 Apr 2026 13:41:40 +0000 (GMT)",
            "by mail-yx1-xb131.google.com with SMTP id\n 956f58d0204a3-6589bfb4de2so465056d50.2\n for <libc-alpha@sourceware.org>; Tue, 28 Apr 2026 06:41:40 -0700 (PDT)",
            "from mandiga.. ([2804:1b3:a7c0:44cb:2a9c:8e72:266:22b5])\n by smtp.gmail.com with ESMTPSA id\n 956f58d0204a3-65bee432a8csm1738558d50.12.2026.04.28.06.41.33\n (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n Tue, 28 Apr 2026 06:41:35 -0700 (PDT)"
        ],
        "DKIM-Filter": [
            "OpenDKIM Filter v2.11.0 sourceware.org 663E94B920A1",
            "OpenDKIM Filter v2.11.0 sourceware.org 569514BB593A"
        ],
        "DMARC-Filter": "OpenDMARC Filter v1.4.2 sourceware.org 569514BB593A",
        "ARC-Filter": "OpenARC Filter v1.0.0 sourceware.org 569514BB593A",
        "ARC-Seal": "i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1777383700; cv=none;\n b=AJr6P73Ps9XbG8F0wqM3VL8GgeQWvUX+1+5Js0gB/8adfd+mHmV4CAtG1FmTHL3XIem1RAVpzf/tB7BCLQ7nKD7fZFcS75kENwKZkBgSu0ZSXwm7yGlkObkcsgEEwDyycEyiWxGsZKS1r2MY7Z4Q89tY66fHdVIcrPbPTkVsvpI=",
        "ARC-Message-Signature": "i=1; a=rsa-sha256; d=sourceware.org; s=key;\n t=1777383700; c=relaxed/simple;\n bh=3oaAubpxewXA07wIK1C4xOsgRYhiUhtlj8YBkdPHh8g=;\n h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version;\n b=MfV1zOh0KWZsl8eJU0EVxz+PczfBEkponQcGy4fBjA13qwGu55ssix2rwMBP+qxAkUGMQVneoUSoICHgNtyvgqVT4+AZAUa2OffdENRx4qTrPFGL00Bwbe5j4fDZTaI1TnBru6rgfuvLLPgFgJww6pJ+Ae05g/soukqMFiT2FRM=",
        "ARC-Authentication-Results": "i=1; server2.sourceware.org",
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=linaro.org; s=google; t=1777383698; x=1777988498; darn=sourceware.org;\n h=content-transfer-encoding:mime-version:message-id:date:subject:cc\n :to:from:from:to:cc:subject:date:message-id:reply-to;\n bh=ftUUJXbz9qITcIFE0ASqr+4l3IhXevGZj1FeBLTKtEw=;\n b=YQlwaO85Zd/xUQHptPd+58wml6s3i7HFMJoZgg+B5j/XTtXrdYIQOHxWF1pc8RX8t8\n noIYvFLp9ZJPohMKp/Q1t3+QHzZ7eRDS6ialVLfbOYh/tcPiLs0iMPbInL2E8Wg1LMn7\n TPpWM4SepsQbnvsyW8mnAUj+Zevl+hC/3DKBbdeuYvcv1CQXNuwl100o/n4NIxfUWnUn\n EPWkob/1kzF6T5f1CCxEp7c25zGsKyLK2n6/y5jP+8cBoBHzcLRq6oxETl0t60zlszhQ\n 3GiVu7H0h2a4ebvuTAaUSqN2uTLO2heg9cwcSfPm+yY23gcxDZHG2jCzKx/ADSHru9R+\n GG7A==",
        "X-Google-DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=1e100.net; s=20251104; t=1777383698; x=1777988498;\n h=content-transfer-encoding:mime-version:message-id:date:subject:cc\n :to:from:x-gm-gg:x-gm-message-state:from:to:cc:subject:date\n :message-id:reply-to;\n bh=ftUUJXbz9qITcIFE0ASqr+4l3IhXevGZj1FeBLTKtEw=;\n b=nbi3WWrHx4Xd2zEUEc6/gWgkbjIQMaox3yGZIzE4SKxDy6m/8kp/F67+P33URtk0+E\n TaDnMLv5q+fXP7IB8OGZBfq3JaJo/8UYjd3Pm9tohRFyD2S6z9jUPkXBj5Mtqq7Ehcj9\n 6pId7dstXh11oRsQ2dT7Y+OvtH5Tro+lRtzRPNVUA/O7llkywgfwK7WxC0mImcpMppMj\n OtF3g2U6NNyzAp3hABFsioC9o9rfxjKsbxHDeieTTRXT5sY4M0oo689ERSf0s3KonLxp\n aS7HlxWcEnr1FJhvPreNWHxqGQPwJPuuYYtnGlH3WO1lPKQ7RFS9VX/RDo4XaXDMRKZ+\n XljQ==",
        "X-Gm-Message-State": "AOJu0YxR1zm5vnFIs6pQSZ9BBDiZEqRmWfi1rA00YVbVRdUDWPfyDqSp\n Afne01//CuESwd9yFT0WkGyvdgyyccGwx25xvDXpZPazI4rpTSksCssSPfO+dhNT/LZNALMwcLX\n akzRL",
        "X-Gm-Gg": "AeBDieu+mCMCz9A60jLwl2/YS/tJA1V+Dda1ZVtihtcTGfhUcC9pxg9z4YiwCvGea7M\n +5FWJKnjwvw69sAUWcaqD04fldKhTxuqnr9l0TmnLhzUM31QOJ5QZNQA08e6hhMH0htnttWHhU0\n rUrkrZDBjJrKgR2P06MbFdZG2m9cX05OhCqImqb+cCF9N5acFh3WII0Xazvkhlr3JeDHlm5DO8E\n Eo1ImLe8EA867EiVVXDduDa+Rjy79XTZ0Wg0ZMkZTeQzKtGBsfftFaCk9cGpIGPJwdg5SrtACXk\n Klc6YU88eK9j6tFhYBrH+qIrH+Kah2t3uLylQFE3j/f2bVJG99Qb/bx/hjRodm9JHNvOP2x00rC\n TKHGVo5rvqHTept5Yf5/dsdOstYE7lZfsR8+710xQ6YZjEpJ3Do3iXSQmBybcdx6uFRDb4Q5JL9\n g+EWbJPH/Dk4HHtb/eJHAK0Lt6n5+XTL1FUPxBfh0/eXbs",
        "X-Received": "by 2002:a05:690e:d02:b0:650:367c:83a1 with SMTP id\n 956f58d0204a3-65beed75d9emr2851593d50.21.1777383697599;\n Tue, 28 Apr 2026 06:41:37 -0700 (PDT)",
        "From": "Adhemerval Zanella <adhemerval.zanella@linaro.org>",
        "To": "libc-alpha@sourceware.org",
        "Cc": "Florian Weimer <fweimer@redhat.com>, Kazushi Marukawa <jam@pobox.com>,\n Rui Ueyama <rui314@gmail.com>",
        "Subject": "[PATCH] elf: Defer all IRELATIVE relocations until after PLT setup\n (BZ 20673)",
        "Date": "Tue, 28 Apr 2026 10:40:47 -0300",
        "Message-ID": "<20260428134130.2430638-1-adhemerval.zanella@linaro.org>",
        "X-Mailer": "git-send-email 2.43.0",
        "MIME-Version": "1.0",
        "Content-Type": "text/plain; charset=UTF-8",
        "Content-Transfer-Encoding": "8bit",
        "X-BeenThere": "libc-alpha@sourceware.org",
        "X-Mailman-Version": "2.1.30",
        "Precedence": "list",
        "List-Id": "Libc-alpha mailing list <libc-alpha.sourceware.org>",
        "List-Unsubscribe": "<https://sourceware.org/mailman/options/libc-alpha>,\n <mailto:libc-alpha-request@sourceware.org?subject=unsubscribe>",
        "List-Archive": "<https://sourceware.org/pipermail/libc-alpha/>",
        "List-Post": "<mailto:libc-alpha@sourceware.org>",
        "List-Help": "<mailto:libc-alpha-request@sourceware.org?subject=help>",
        "List-Subscribe": "<https://sourceware.org/mailman/listinfo/libc-alpha>,\n <mailto:libc-alpha-request@sourceware.org?subject=subscribe>",
        "Errors-To": "libc-alpha-bounces~incoming=patchwork.ozlabs.org@sourceware.org"
    },
    "content": "When a shared library is built with -z lazy and its IFUNC resolver calls\na PLT function, the dynamic linker can crash.  The resolver runs while\nthe PLT stubs still hold their raw ELF virtual addresses — l_addr has\nnot yet been added — so the call branches to an unmapped address.\n\nThe old code deferred IRELATIVE entries only to the end of the relocation\nrange currently being processed (via the r2/end2 scan-ahead mechanism in\nelf_dynamic_do_Rel).  This was sufficient only when both IRELATIVE and the\nJMP_SLOT entries for the PLT functions it needs are in the same section.\nOn x86-64, aarch64, arm, i386 and most other targets, a file-scope\ninitialiser of the form\n\n  int (*fptr)(void) = some_ifunc;\n\ncauses the linker to place R_*_IRELATIVE in .rela.dyn, while JMP_SLOT\nentries for any PLT calls made by the resolver live in .rela.plt.\nProcessing .rela.dyn before .rela.plt means the resolver fires before the\nPLT is usable, regardless of where within .rela.dyn IRELATIVE appears.\n\nFix this by splitting IRELATIVE processing into a separate, explicitly\ndeferred pass.  In elf/do-rel.h:\n\n - Remove the r2/end2 variables and the post-loop IRELATIVE re-scan from\n   elf_dynamic_do_Rel.  IRELATIVE entries are now always skipped in the\n   non-bootstrap path.\n\n - Add a new elf_dynamic_do_Rel_irelative function that scans a\n   relocation range and calls elf_machine_rel/elf_machine_lazy_rel for\n   IRELATIVE and ifunc relocations.\n\nIn elf/dynamic-link.h, update _ELF_DYNAMIC_DO_RELOC to use a two-phase\napproach for non-bootstrap builds unconditionally (regardless of whether\nranges[1].size is zero):\n\n Phase 1+2: elf_dynamic_do_Rel over .rela.dyn then .rela.plt — processes\n            everything except IRELATIVE/STT_GNU_IFUNC.\n Phase 3+4: elf_dynamic_do_Rel_irelative over .rela.dyn then .rela.plt —\n            processes only IRELATIVE, by which point all PLT stubs are\n            valid.\n\nThis guarantees that IRELATIVE resolvers can call PLT stubs safely\nregardless of which section the linker placed R_*_IRELATIVE in.\n\nAdd ELF_MACHINE_IRELATIVE to the architectures that were missing it so\nthe new skip logic in elf_dynamic_do_Rel is compiled for all targets.\n\nI checked on all ABI that support iFUNC (x86_64, i686, aarch64, arm,\nloongarch, powerpc, riscv, s390, and sparc), although on some through\nqemu-system (which should not matter for this case).\n\nIt also fixes the mold reported issues [1], which shows an example\nwhere IFUNC relocation placement and processing can works different\nfor different ABIs.\n\n[1] https://github.com/rui314/mold/issues/1550\n---\n elf/Makefile                           |  12 ++\n elf/do-rel.h                           | 179 +++++++++++++++----------\n elf/dynamic-link.h                     |  37 +++--\n elf/tst-ifunc-plt-dep.c                |  23 ++++\n elf/tst-ifunc-plt-dlopen.c             |  46 +++++++\n elf/tst-ifunc-plt-lib.c                |  56 ++++++++\n elf/tst-ifunc-plt.c                    |  38 ++++++\n sysdeps/aarch64/dl-machine.h           |   1 +\n sysdeps/arm/dl-machine.h               |   1 +\n sysdeps/i386/dl-machine.h              |   1 +\n sysdeps/powerpc/powerpc32/dl-machine.h |   1 +\n sysdeps/powerpc/powerpc64/dl-machine.h |   1 +\n sysdeps/riscv/dl-machine.h             |   1 +\n sysdeps/sparc/sparc32/dl-machine.h     |   1 +\n sysdeps/sparc/sparc64/dl-machine.h     |   1 +\n 15 files changed, 320 insertions(+), 79 deletions(-)\n create mode 100644 elf/tst-ifunc-plt-dep.c\n create mode 100644 elf/tst-ifunc-plt-dlopen.c\n create mode 100644 elf/tst-ifunc-plt-lib.c\n create mode 100644 elf/tst-ifunc-plt.c",
    "diff": "diff --git a/elf/Makefile b/elf/Makefile\nindex c835eb8156..377ea2c0cc 100644\n--- a/elf/Makefile\n+++ b/elf/Makefile\n@@ -1252,6 +1252,8 @@ ifeq (yes,$(build-shared))\n tests += \\\n   tst-ifunc-fault-bindnow \\\n   tst-ifunc-fault-lazy \\\n+  tst-ifunc-plt \\\n+  tst-ifunc-plt-dlopen \\\n   # tests\n # Note: sysdeps/x86_64/ifuncmain8.c uses ifuncmain8.\n tests-internal += \\\n@@ -1314,6 +1316,8 @@ modules-names += \\\n   ifuncmod1 \\\n   ifuncmod3 \\\n   ifuncmod6 \\\n+  tst-ifunc-plt-dep \\\n+  tst-ifunc-plt-lib \\\n   # modules-names\n ifeq (no,$(with-lld))\n modules-names += ifuncmod5\n@@ -1793,6 +1797,7 @@ unload4mod1.so-no-z-defs = yes\n ifuncmod1.so-no-z-defs = yes\n ifuncmod5.so-no-z-defs = yes\n ifuncmod6.so-no-z-defs = yes\n+tst-ifunc-plt-lib.so-no-z-defs = yes\n tst-auditmod9a.so-no-z-defs = yes\n tst-auditmod9b.so-no-z-defs = yes\n tst-nodelete-uniquemod.so-no-z-defs = yes\n@@ -2426,6 +2431,13 @@ $(objpfx)tst-ifunc-fault-bindnow.out: $(objpfx)tst-ifunc-fault-bindnow \\\n    $(objpfx)ld.so\n \t$(tst-ifunc-fault-script)\n \n+LDFLAGS-tst-ifunc-plt-lib.so = -Wl,-z,lazy\n+\n+$(objpfx)tst-ifunc-plt-lib.so: $(objpfx)tst-ifunc-plt-dep.so\n+$(objpfx)tst-ifunc-plt: $(objpfx)tst-ifunc-plt-lib.so\n+$(objpfx)tst-ifunc-plt-dlopen.out: \\\n+  $(objpfx)tst-ifunc-plt-lib.so $(objpfx)tst-ifunc-plt-dep.so\n+\n $(objpfx)tst-unique1.out: $(objpfx)tst-unique1mod1.so \\\n \t\t\t  $(objpfx)tst-unique1mod2.so\n \ndiff --git a/elf/do-rel.h b/elf/do-rel.h\nindex d00ffab7e9..e7912d4ed4 100644\n--- a/elf/do-rel.h\n+++ b/elf/do-rel.h\n@@ -23,6 +23,8 @@\n \n #ifdef DO_RELA\n # define elf_dynamic_do_Rel\t\telf_dynamic_do_Rela\n+# define elf_dynamic_do_Rel_irelative\telf_dynamic_do_Rela_irelative\n+# define elf_dynamic_is_Rel_irelative\telf_dynamic_is_Rela_irelative\n # define Rel\t\t\t\tRela\n # define elf_machine_rel\t\telf_machine_rela\n # define elf_machine_rel_relative\telf_machine_rela_relative\n@@ -34,16 +36,34 @@\n \t\t\t    (void *) (l_addr + relative->r_offset))\n #endif\n \n+static __always_inline bool\n+elf_dynamic_is_Rel_irelative (const ElfW(Rel) *reloc, const ElfW(Sym) *sym)\n+{\n+#ifdef ELF_MACHINE_IRELATIVE\n+  const unsigned int r_type = ELFW (R_TYPE) (reloc->r_info);\n+  return ((sym != NULL\n+\t   && ELFW(ST_TYPE) (sym->st_info) == STT_GNU_IFUNC\n+\t   && sym->st_shndx != SHN_UNDEF)\n+\t  || r_type == ELF_MACHINE_IRELATIVE);\n+#else\n+  return false;\n+#endif\n+}\n+\n /* Perform the relocations in MAP on the running program image as specified\n    by RELTAG, SZTAG.  If LAZY is nonzero, this is the first pass on PLT\n    relocations; they should be set up to call _dl_runtime_resolve, rather\n-   than fully resolved now.  */\n+   than fully resolved now.\n+\n+   IRELATIVE entries are always skipped (non-bootstrap); they are handled\n+   separately by elf_dynamic_do_Rel_irelative after all other relocations\n+   for both .rel.dyn and .rel.plt have been processed.  */\n \n static inline void __attribute__ ((always_inline))\n elf_dynamic_do_Rel (struct link_map *map, struct r_scope_elem *scope[],\n \t\t    ElfW(Addr) reladdr, ElfW(Addr) relsize,\n \t\t    __typeof (((ElfW(Dyn) *) 0)->d_un.d_val) nrelative,\n-\t\t    int lazy, int skip_ifunc)\n+\t\t    int lazy)\n {\n   const ElfW(Rel) *relative = (const void *) reladdr;\n   const ElfW(Rel) *r = relative + nrelative;\n@@ -65,14 +85,9 @@ elf_dynamic_do_Rel (struct link_map *map, struct r_scope_elem *scope[],\n       void *const r_addr_arg = (void *) (l_addr + r->r_offset);\n       const struct r_found_version *rversion = &map->l_versions[ndx];\n \n-      elf_machine_rel (map, scope, r, sym, rversion, r_addr_arg, skip_ifunc);\n+      elf_machine_rel (map, scope, r, sym, rversion, r_addr_arg, 0);\n     }\n #else /* !RTLD_BOOTSTRAP */\n-# if defined ELF_MACHINE_IRELATIVE\n-  const ElfW(Rel) *r2 = NULL;\n-  const ElfW(Rel) *end2 = NULL;\n-# endif\n-\n #if !defined DO_RELA || !defined ELF_MACHINE_PLT_REL\n   /* We never bind lazily during ld.so bootstrap.  Unfortunately gcc is\n      not clever enough to see through all the function calls to realize\n@@ -81,23 +96,12 @@ elf_dynamic_do_Rel (struct link_map *map, struct r_scope_elem *scope[],\n     {\n       /* Doing lazy PLT relocations; they need very little info.  */\n       for (; r < end; ++r)\n-# ifdef ELF_MACHINE_IRELATIVE\n-\tif (ELFW(R_TYPE) (r->r_info) == ELF_MACHINE_IRELATIVE)\n-\t  {\n-\t    if (r2 == NULL)\n-\t      r2 = r;\n-\t    end2 = r;\n-\t  }\n-\telse\n-# endif\n-\t  elf_machine_lazy_rel (map, scope, l_addr, r, skip_ifunc);\n-\n-# ifdef ELF_MACHINE_IRELATIVE\n-      if (r2 != NULL)\n-\tfor (; r2 <= end2; ++r2)\n-\t  if (ELFW(R_TYPE) (r2->r_info) == ELF_MACHINE_IRELATIVE)\n-\t    elf_machine_lazy_rel (map, scope, l_addr, r2, skip_ifunc);\n-# endif\n+\t{\n+\t  const ElfW (Sym) *sym = &symtab[ELFW (R_SYM) (r->r_info)];\n+\t  if (elf_dynamic_is_Rel_irelative (r, sym))\n+\t    continue;\n+\t  elf_machine_lazy_rel (map, scope, l_addr, r, 0);\n+\t}\n     }\n   else\n #endif\n@@ -125,18 +129,10 @@ elf_dynamic_do_Rel (struct link_map *map, struct r_scope_elem *scope[],\n \t      const ElfW(Sym) *sym = &symtab[ELFW(R_SYM) (r->r_info)];\n \t      void *const r_addr_arg = (void *) (l_addr + r->r_offset);\n \t      const struct r_found_version *rversion = &map->l_versions[ndx];\n-#if defined ELF_MACHINE_IRELATIVE\n-\t      if (ELFW(R_TYPE) (r->r_info) == ELF_MACHINE_IRELATIVE)\n-\t\t{\n-\t\t  if (r2 == NULL)\n-\t\t    r2 = r;\n-\t\t  end2 = r;\n-\t\t  continue;\n-\t\t}\n-#endif\n \n-\t      elf_machine_rel (map, scope, r, sym, rversion, r_addr_arg,\n-\t\t\t       skip_ifunc);\n+\t      if (elf_dynamic_is_Rel_irelative (r, sym))\n+\t\tcontinue;\n+\t      elf_machine_rel (map, scope, r, sym, rversion, r_addr_arg, 0);\n #if defined SHARED\n \t      if (ELFW(R_TYPE) (r->r_info) == ELF_MACHINE_JMP_SLOT\n \t\t  && GLRO(dl_naudit) > 0)\n@@ -150,21 +146,6 @@ elf_dynamic_do_Rel (struct link_map *map, struct r_scope_elem *scope[],\n \t\t}\n #endif\n \t    }\n-\n-#if defined ELF_MACHINE_IRELATIVE\n-\t  if (r2 != NULL)\n-\t    for (; r2 <= end2; ++r2)\n-\t      if (ELFW(R_TYPE) (r2->r_info) == ELF_MACHINE_IRELATIVE)\n-\t\t{\n-\t\t  ElfW(Half) ndx\n-\t\t    = version[ELFW(R_SYM) (r2->r_info)] & 0x7fff;\n-\t\t  elf_machine_rel (map, scope, r2,\n-\t\t\t\t   &symtab[ELFW(R_SYM) (r2->r_info)],\n-\t\t\t\t   &map->l_versions[ndx],\n-\t\t\t\t   (void *) (l_addr + r2->r_offset),\n-\t\t\t\t   skip_ifunc);\n-\t\t}\n-#endif\n \t}\n       else\n \t{\n@@ -172,17 +153,10 @@ elf_dynamic_do_Rel (struct link_map *map, struct r_scope_elem *scope[],\n \t    {\n \t      const ElfW(Sym) *sym = &symtab[ELFW(R_SYM) (r->r_info)];\n \t      void *const r_addr_arg = (void *) (l_addr + r->r_offset);\n-# ifdef ELF_MACHINE_IRELATIVE\n-\t      if (ELFW(R_TYPE) (r->r_info) == ELF_MACHINE_IRELATIVE)\n-\t\t{\n-\t\t  if (r2 == NULL)\n-\t\t    r2 = r;\n-\t\t  end2 = r;\n-\t\t  continue;\n-\t\t}\n-# endif\n-\t      elf_machine_rel (map, scope, r, sym, NULL, r_addr_arg,\n-\t\t\t       skip_ifunc);\n+\n+\t      if (elf_dynamic_is_Rel_irelative (r, sym))\n+\t\tcontinue;\n+\t      elf_machine_rel (map, scope, r, sym, NULL, r_addr_arg, 1);\n # if defined SHARED\n \t      if (ELFW(R_TYPE) (r->r_info) == ELF_MACHINE_JMP_SLOT\n \t\t  && GLRO(dl_naudit) > 0)\n@@ -197,21 +171,84 @@ elf_dynamic_do_Rel (struct link_map *map, struct r_scope_elem *scope[],\n \t\t}\n # endif\n \t    }\n-\n-# ifdef ELF_MACHINE_IRELATIVE\n-\t  if (r2 != NULL)\n-\t    for (; r2 <= end2; ++r2)\n-\t      if (ELFW(R_TYPE) (r2->r_info) == ELF_MACHINE_IRELATIVE)\n-\t\telf_machine_rel (map, scope, r2, &symtab[ELFW(R_SYM) (r2->r_info)],\n-\t\t\t\t NULL, (void *) (l_addr + r2->r_offset),\n-\t\t\t\t skip_ifunc);\n-# endif\n \t}\n     }\n #endif /* !RTLD_BOOTSTRAP */\n }\n \n+/* Process only IRELATIVE entries in the relocation range\n+   [reladdr, reladdr+relsize).  When lazy is non-zero the PLT lazy-binding\n+   path (elf_machine_lazy_rel) is used, otherwise the full non-lazy path\n+   (elf_machine_rel) is used.\n+\n+   Called by _ELF_DYNAMIC_DO_RELOC after all non-IRELATIVE relocations have\n+   been processed for both .rela.dyn and .rela.plt, so that IRELATIVE\n+   resolvers may call PLT stubs safely regardless of which section the linker\n+   placed R_*_IRELATIVE in.  */\n+static __always_inline void\n+elf_dynamic_do_Rel_irelative (struct link_map *map,\n+\t\t\t      struct r_scope_elem *scope[],\n+\t\t\t      ElfW(Addr) reladdr, ElfW(Addr) relsize,\n+\t\t\t      int lazy, int skip_ifunc)\n+{\n+# ifdef ELF_MACHINE_IRELATIVE\n+  const ElfW(Rel) *r = (const void *) reladdr;\n+  const ElfW(Rel) *end = (const void *) (reladdr + relsize);\n+  ElfW(Addr) l_addr = map->l_addr;\n+  const ElfW(Sym) *const symtab = (const void *) D_PTR (map, l_info[DT_SYMTAB]);\n+\n+  if (lazy)\n+    {\n+      for (; r < end; ++r)\n+\t{\n+\t  const ElfW (Sym) *sym = &symtab[ELFW (R_SYM) (r->r_info)];\n+\t  if (!elf_dynamic_is_Rel_irelative (r, sym))\n+\t    continue;\n+\t  elf_machine_lazy_rel (map, scope, l_addr, r, skip_ifunc);\n+\t}\n+    }\n+  else\n+    {\n+      if (map->l_info[VERSYMIDX (DT_VERSYM)])\n+\t{\n+\t  const ElfW(Half) *const version =\n+\t    (const void *) D_PTR (map, l_info[VERSYMIDX (DT_VERSYM)]);\n+\n+\t  for (; r < end; ++r)\n+\t    {\n+\t      const ElfW (Sym) *sym = &symtab[ELFW (R_SYM) (r->r_info)];\n+\t      if (!elf_dynamic_is_Rel_irelative (r, sym))\n+\t\tcontinue;\n+\n+\t      ElfW(Half) ndx = version[ELFW(R_SYM) (r->r_info)] & 0x7fff;\n+\t      elf_machine_rel (map, scope, r,\n+\t\t\t       &symtab[ELFW(R_SYM) (r->r_info)],\n+\t\t\t       &map->l_versions[ndx],\n+\t\t\t       (void *) (l_addr + r->r_offset),\n+\t\t\t       skip_ifunc);\n+\t    }\n+\t}\n+      else\n+\t{\n+\t  for (; r < end; ++r)\n+\t    {\n+\t      const ElfW (Sym) *sym = &symtab[ELFW (R_SYM) (r->r_info)];\n+\t      if (!elf_dynamic_is_Rel_irelative (r, sym))\n+\t\tcontinue;\n+\n+\t      elf_machine_rel (map, scope, r,\n+\t\t\t       &symtab[ELFW(R_SYM) (r->r_info)],\n+\t\t\t       NULL,\n+\t\t\t       (void *) (l_addr + r->r_offset),\n+\t\t\t       skip_ifunc);\n+\t    }\n+\t}\n+    }\n+# endif\n+}\n+\n #undef elf_dynamic_do_Rel\n+#undef elf_dynamic_do_Rel_irelative\n #undef Rel\n #undef elf_machine_rel\n #undef elf_machine_rel_relative\ndiff --git a/elf/dynamic-link.h b/elf/dynamic-link.h\nindex a46f36b8d4..2055d910c6 100644\n--- a/elf/dynamic-link.h\n+++ b/elf/dynamic-link.h\n@@ -78,7 +78,8 @@ elf_machine_lazy_rel (struct link_map *map, struct r_scope_elem *scope[],\n    consumes precisely the very end of the DT_REL*, or DT_JMPREL and DT_REL*\n    are completely separate and there is a gap between them.  */\n \n-# define _ELF_DYNAMIC_DO_RELOC(RELOC, reloc, map, scope, do_lazy, skip_ifunc, test_rel) \\\n+# define _ELF_DYNAMIC_DO_RELOC(RELOC, reloc, map, scope, do_lazy, skip_ifunc, \\\n+\t\t\t       test_rel)\t\t\t\t      \\\n   do {\t\t\t\t\t\t\t\t\t      \\\n     struct { ElfW(Addr) start, size;\t\t\t\t\t      \\\n \t     __typeof (((ElfW(Dyn) *) 0)->d_un.d_val) nrelative; int lazy; }  \\\n@@ -118,13 +119,33 @@ elf_machine_lazy_rel (struct link_map *map, struct r_scope_elem *scope[],\n \t  }\t\t\t\t\t\t\t\t      \\\n       }\t\t\t\t\t\t\t\t\t      \\\n \t\t\t\t\t\t\t\t\t      \\\n-      for (int ranges_index = 0; ranges_index < 2; ++ranges_index)\t      \\\n-        elf_dynamic_do_##reloc ((map), scope,\t\t\t\t      \\\n-\t\t\t\tranges[ranges_index].start,\t\t      \\\n-\t\t\t\tranges[ranges_index].size,\t\t      \\\n-\t\t\t\tranges[ranges_index].nrelative,\t\t      \\\n-\t\t\t\tranges[ranges_index].lazy,\t\t      \\\n-\t\t\t\tskip_ifunc);\t\t\t\t      \\\n+      /* Defer all IRELATIVE relocations until after all non-IRELATIVE\t      \\\n+\t relocations (including PLT lazy-binding setup) have been processed   \\\n+\t for both sections.  This ensures IRELATIVE resolvers can call PLT    \\\n+\t stubs safely regardless of which section R_*_IRELATIVE was placed in \\\n+\t by the linker.  */\t\t\t\t\t\t      \\\n+      if (!DO_RTLD_BOOTSTRAP)\t\t\t\t\t\t      \\\n+\t{\t\t\t\t\t\t\t\t      \\\n+\t  for (int ranges_index = 0; ranges_index < 2; ++ranges_index)\t      \\\n+\t    elf_dynamic_do_##reloc ((map), scope,\t\t\t      \\\n+\t\t\t\t    ranges[ranges_index].start,\t\t      \\\n+\t\t\t\t    ranges[ranges_index].size,\t\t      \\\n+\t\t\t\t    ranges[ranges_index].nrelative,\t      \\\n+\t\t\t\t    ranges[ranges_index].lazy);\t\t      \\\n+\t  for (int ranges_index = 0; ranges_index < 2; ++ranges_index)\t      \\\n+\t    elf_dynamic_do_##reloc##_irelative ((map), scope,\t\t      \\\n+\t\t\t\t\t\tranges[ranges_index].start,   \\\n+\t\t\t\t\t\tranges[ranges_index].size,    \\\n+\t\t\t\t\t\tranges[ranges_index].lazy,    \\\n+\t\t\t\t\t\tskip_ifunc);\t\t      \\\n+\t}\t\t\t\t\t\t\t\t      \\\n+      else\t\t\t\t\t\t\t\t      \\\n+\tfor (int ranges_index = 0; ranges_index < 2; ++ranges_index)\t      \\\n+\t  elf_dynamic_do_##reloc ((map), scope,\t\t\t\t      \\\n+\t\t\t\t  ranges[ranges_index].start,\t\t      \\\n+\t\t\t\t  ranges[ranges_index].size,\t\t      \\\n+\t\t\t\t  ranges[ranges_index].nrelative,\t      \\\n+\t\t\t\t  ranges[ranges_index].lazy);\t\t      \\\n   } while (0)\n \n # if ELF_MACHINE_NO_REL || ELF_MACHINE_NO_RELA\ndiff --git a/elf/tst-ifunc-plt-dep.c b/elf/tst-ifunc-plt-dep.c\nnew file mode 100644\nindex 0000000000..9cf2b1b0b2\n--- /dev/null\n+++ b/elf/tst-ifunc-plt-dep.c\n@@ -0,0 +1,23 @@\n+/* Dependency library for tst-ifunc-plt.\n+   Copyright (C) 2026 Free Software Foundation, Inc.\n+   This file is part of the GNU C Library.\n+\n+   The GNU C Library is free software; you can redistribute it and/or\n+   modify it under the terms of the GNU Lesser General Public\n+   License as published by the Free Software Foundation; either\n+   version 2.1 of the License, or (at your option) any later version.\n+\n+   The GNU C Library is distributed in the hope that it will be useful,\n+   but WITHOUT ANY WARRANTY; without even the implied warranty of\n+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU\n+   Lesser General Public License for more details.\n+\n+   You should have received a copy of the GNU Lesser General Public\n+   License along with the GNU C Library; if not, see\n+   <https://www.gnu.org/licenses/>.  */\n+\n+int\n+get_value (void)\n+{\n+  return 42;\n+}\ndiff --git a/elf/tst-ifunc-plt-dlopen.c b/elf/tst-ifunc-plt-dlopen.c\nnew file mode 100644\nindex 0000000000..ed9d69b69c\n--- /dev/null\n+++ b/elf/tst-ifunc-plt-dlopen.c\n@@ -0,0 +1,46 @@\n+/* Test for BZ #20673 via dlopen.\n+   Copyright (C) 2026 Free Software Foundation, Inc.\n+   This file is part of the GNU C Library.\n+\n+   The GNU C Library is free software; you can redistribute it and/or\n+   modify it under the terms of the GNU Lesser General Public\n+   License as published by the Free Software Foundation; either\n+   version 2.1 of the License, or (at your option) any later version.\n+\n+   The GNU C Library is distributed in the hope that it will be useful,\n+   but WITHOUT ANY WARRANTY; without even the implied warranty of\n+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU\n+   Lesser General Public License for more details.\n+\n+   You should have received a copy of the GNU Lesser General Public\n+   License along with the GNU C Library; if not, see\n+   <https://www.gnu.org/licenses/>.  */\n+\n+\n+/* dlopen tst-ifunc-plt-lib.so with RTLD_LAZY and verify that the IFUNC\n+   resolver (which calls get_value() via PLT) ran successfully.  This\n+   exercises the same _dl_relocate_object code path as startup loading\n+   but via the dlopen entry point.  */\n+\n+#include <support/xdlfcn.h>\n+#include <support/check.h>\n+\n+typedef int (*fn_t) (void);\n+\n+static int\n+do_test (void)\n+{\n+  void *handle = xdlopen (\"tst-ifunc-plt-lib.so\", RTLD_LAZY | RTLD_LOCAL);\n+\n+  fn_t compute_a = (fn_t) xdlsym (handle, \"compute_a\");\n+  TEST_COMPARE (compute_a (), 1);\n+\n+  fn_t compute_b = (fn_t) xdlsym (handle, \"compute_b\");\n+  TEST_COMPARE (compute_b (), 2);\n+\n+  xdlclose (handle);\n+\n+  return 0;\n+}\n+\n+#include <support/test-driver.c>\ndiff --git a/elf/tst-ifunc-plt-lib.c b/elf/tst-ifunc-plt-lib.c\nnew file mode 100644\nindex 0000000000..650231ff28\n--- /dev/null\n+++ b/elf/tst-ifunc-plt-lib.c\n@@ -0,0 +1,56 @@\n+/* Shared library for tst-ifunc-plt-multi (bug 20673).\n+   Two static IFUNCs whose resolvers both call get_value() via PLT.\n+   Copyright (C) 2026 Free Software Foundation, Inc.\n+   This file is part of the GNU C Library.\n+\n+   The GNU C Library is free software; you can redistribute it and/or\n+   modify it under the terms of the GNU Lesser General Public\n+   License as published by the Free Software Foundation; either\n+   version 2.1 of the License, or (at your option) any later version.\n+\n+   The GNU C Library is distributed in the hope that it will be useful,\n+   but WITHOUT ANY WARRANTY; without even the implied warranty of\n+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU\n+   Lesser General Public License for more details.\n+\n+   You should have received a copy of the GNU Lesser General Public\n+   License along with the GNU C Library; if not, see\n+   <https://www.gnu.org/licenses/>.  */\n+\n+\n+/* Both resolvers call get_value() via PLT (one JUMP_SLOT entry in\n+   .rel{a}.plt).  This verifies that every IRELATIVE entry is deferred\n+   until after .rela.plt has been processed, not just the first one.  */\n+\n+#include <stddef.h>\n+\n+extern int get_value (void);\n+\n+static int\n+impl_a (void)\n+{\n+  return 1;\n+}\n+\n+static int\n+impl_b (void)\n+{\n+  return 2;\n+}\n+\n+static int (*\n+resolve_a (void)) (void)\n+{\n+  return get_value () == 42 ? impl_a : NULL;\n+}\n+\n+static int (*\n+resolve_b (void)) (void)\n+{\n+  return get_value () == 42 ? impl_b : NULL;\n+}\n+\n+/* The test is only built for $(have-ifunc), so we can assume HAVE_GCC_IFUNC\n+   here.  */\n+int compute_a (void) __attribute__ ((ifunc (\"resolve_a\")));\n+int compute_b (void) __attribute__ ((ifunc (\"resolve_b\")));\ndiff --git a/elf/tst-ifunc-plt.c b/elf/tst-ifunc-plt.c\nnew file mode 100644\nindex 0000000000..382f90d852\n--- /dev/null\n+++ b/elf/tst-ifunc-plt.c\n@@ -0,0 +1,38 @@\n+/* Test for BZ #20673.\n+   Copyright (C) 2026 Free Software Foundation, Inc.\n+   This file is part of the GNU C Library.\n+\n+   The GNU C Library is free software; you can redistribute it and/or\n+   modify it under the terms of the GNU Lesser General Public\n+   License as published by the Free Software Foundation; either\n+   version 2.1 of the License, or (at your option) any later version.\n+\n+   The GNU C Library is distributed in the hope that it will be useful,\n+   but WITHOUT ANY WARRANTY; without even the implied warranty of\n+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU\n+   Lesser General Public License for more details.\n+\n+   You should have received a copy of the GNU Lesser General Public\n+   License along with the GNU C Library; if not, see\n+   <https://www.gnu.org/licenses/>.  */\n+\n+\n+/* tst-ifunc-plt-multi-lib.so defines two static IFUNCs (compute_a and\n+   compute_b), each producing an R_*_IRELATIVE in .rel{a}.dyn, with both\n+   resolvers calling get_value() via PLT.  The test verifies that both\n+   IRELATIVEs are deferred until after .rel{a}.plt is processed.  */\n+\n+#include <support/check.h>\n+\n+extern int compute_a (void);\n+extern int compute_b (void);\n+\n+static int\n+do_test (void)\n+{\n+  TEST_COMPARE (compute_a (), 1);\n+  TEST_COMPARE (compute_b (), 2);\n+  return 0;\n+}\n+\n+#include <support/test-driver.c>\ndiff --git a/sysdeps/aarch64/dl-machine.h b/sysdeps/aarch64/dl-machine.h\nindex 21af8bc56e..15651c62f3 100644\n--- a/sysdeps/aarch64/dl-machine.h\n+++ b/sysdeps/aarch64/dl-machine.h\n@@ -119,6 +119,7 @@ elf_machine_runtime_setup (struct link_map *l, struct r_scope_elem *scope[],\n    | (((type) == R_AARCH64_COPY) * ELF_RTYPE_CLASS_COPY))\n \n #define ELF_MACHINE_JMP_SLOT\tR_AARCH64_JUMP_SLOT\n+#define ELF_MACHINE_IRELATIVE\tR_AARCH64_IRELATIVE\n \n #define DL_PLATFORM_INIT dl_platform_init ()\n \ndiff --git a/sysdeps/arm/dl-machine.h b/sysdeps/arm/dl-machine.h\nindex e0065ce73c..15cced693e 100644\n--- a/sysdeps/arm/dl-machine.h\n+++ b/sysdeps/arm/dl-machine.h\n@@ -190,6 +190,7 @@ _dl_start_user:\\n\\\n \n /* A reloc type used for ld.so cmdline arg lookups to reject PLT entries.  */\n #define ELF_MACHINE_JMP_SLOT\tR_ARM_JUMP_SLOT\n+#define ELF_MACHINE_IRELATIVE\tR_ARM_IRELATIVE\n \n /* We define an initialization functions.  This is called very early in\n    _dl_sysdep_start.  */\ndiff --git a/sysdeps/i386/dl-machine.h b/sysdeps/i386/dl-machine.h\nindex 6657f68791..dd49079d75 100644\n--- a/sysdeps/i386/dl-machine.h\n+++ b/sysdeps/i386/dl-machine.h\n@@ -190,6 +190,7 @@ _dl_start_user:\\n\\\n \n /* A reloc type used for ld.so cmdline arg lookups to reject PLT entries.  */\n #define ELF_MACHINE_JMP_SLOT\tR_386_JMP_SLOT\n+#define ELF_MACHINE_IRELATIVE\tR_386_IRELATIVE\n \n /* We define an initialization functions.  This is called very early in\n    _dl_sysdep_start.  */\ndiff --git a/sysdeps/powerpc/powerpc32/dl-machine.h b/sysdeps/powerpc/powerpc32/dl-machine.h\nindex d787298636..e07a44a5a5 100644\n--- a/sysdeps/powerpc/powerpc32/dl-machine.h\n+++ b/sysdeps/powerpc/powerpc32/dl-machine.h\n@@ -146,6 +146,7 @@ __elf_preferred_address(struct link_map *loader, size_t maplength,\n \n /* A reloc type used for ld.so cmdline arg lookups to reject PLT entries.  */\n #define ELF_MACHINE_JMP_SLOT\tR_PPC_JMP_SLOT\n+#define ELF_MACHINE_IRELATIVE\tR_PPC_IRELATIVE\n \n /* We define an initialization function to initialize HWCAP/HWCAP2 and\n    platform data so it can be copied into the TCB later.  This is called\ndiff --git a/sysdeps/powerpc/powerpc64/dl-machine.h b/sysdeps/powerpc/powerpc64/dl-machine.h\nindex 6e3771c91c..1f5d7a0170 100644\n--- a/sysdeps/powerpc/powerpc64/dl-machine.h\n+++ b/sysdeps/powerpc/powerpc64/dl-machine.h\n@@ -304,6 +304,7 @@ BODY_PREFIX \"_dl_start_user:\\n\"\t\t\t\t\t\t\\\n \n /* A reloc type used for ld.so cmdline arg lookups to reject PLT entries.  */\n #define ELF_MACHINE_JMP_SLOT\tR_PPC64_JMP_SLOT\n+#define ELF_MACHINE_IRELATIVE\tR_PPC64_IRELATIVE\n \n /* We define an initialization function to initialize HWCAP/HWCAP2 and\n    platform data so it can be copied into the TCB later.  This is called\ndiff --git a/sysdeps/riscv/dl-machine.h b/sysdeps/riscv/dl-machine.h\nindex 8c7312ad98..babb52af20 100644\n--- a/sysdeps/riscv/dl-machine.h\n+++ b/sysdeps/riscv/dl-machine.h\n@@ -42,6 +42,7 @@\n #endif\n \n #define ELF_MACHINE_JMP_SLOT R_RISCV_JUMP_SLOT\n+#define ELF_MACHINE_IRELATIVE R_RISCV_IRELATIVE\n \n #define elf_machine_type_class(type)\t\t\t\t\\\n   ((ELF_RTYPE_CLASS_PLT * ((type) == ELF_MACHINE_JMP_SLOT\t\\\ndiff --git a/sysdeps/sparc/sparc32/dl-machine.h b/sysdeps/sparc/sparc32/dl-machine.h\nindex 73b347bfdf..3771339a04 100644\n--- a/sysdeps/sparc/sparc32/dl-machine.h\n+++ b/sysdeps/sparc/sparc32/dl-machine.h\n@@ -156,6 +156,7 @@ elf_machine_runtime_setup (struct link_map *l, struct r_scope_elem *scope[],\n \n /* A reloc type used for ld.so cmdline arg lookups to reject PLT entries.  */\n #define ELF_MACHINE_JMP_SLOT\tR_SPARC_JMP_SLOT\n+#define ELF_MACHINE_IRELATIVE\tR_SPARC_IRELATIVE\n \n /* Undo the sub %sp, 6*4, %sp; add %sp, 22*4, %o0 below to get at the\n    value we want in __libc_stack_end.  */\ndiff --git a/sysdeps/sparc/sparc64/dl-machine.h b/sysdeps/sparc/sparc64/dl-machine.h\nindex 856922680a..8a1a38d170 100644\n--- a/sysdeps/sparc/sparc64/dl-machine.h\n+++ b/sysdeps/sparc/sparc64/dl-machine.h\n@@ -119,6 +119,7 @@ elf_machine_plt_value (struct link_map *map, const Elf64_Rela *reloc,\n \n /* A reloc type used for ld.so cmdline arg lookups to reject PLT entries.  */\n #define ELF_MACHINE_JMP_SLOT\tR_SPARC_JMP_SLOT\n+#define ELF_MACHINE_IRELATIVE\tR_SPARC_IRELATIVE\n \n /* Set up the loaded object described by L so its unrelocated PLT\n    entries will jump to the on-demand fixup code in dl-runtime.c.  */\n",
    "prefixes": []
}