From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-yw1-x1134.google.com (mail-yw1-x1134.google.com [IPv6:2607:f8b0:4864:20::1134]) by sourceware.org (Postfix) with ESMTPS id 837783858C78 for ; Fri, 29 Sep 2023 15:16:53 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 837783858C78 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-yw1-x1134.google.com with SMTP id 00721157ae682-59c0d002081so173372277b3.2 for ; Fri, 29 Sep 2023 08:16:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1696000612; x=1696605412; darn=sourceware.org; h=to:subject:message-id:date:from:mime-version:from:to:cc:subject :date:message-id:reply-to; bh=sF7UWYtQkK4JO9GUfAR47Wy7KWztM2qiywyKsJRSNkY=; b=TMLrIpHMzNklRb9IV1c3sRLnlAHVgalXR4sRviFjcESo8soa7/bsG8H445hpCagzDq K+/jdTJMwGdDCzW0icHjdrjhO/DHFp/qauy1ufv3flTEJShdXGYje7jzDJ9vF1XNg+VL vrIR0mv4A3LQvRCCBSNJQKsuE6Di+1dNHKjZly6Q+xnKC5mP4ixjGf4WegegMCcKTzMG TVsl0I30cfxIpi+1x8K810mUcIV8wceBIeRmTAX49wiz/v+YjaBo/aZOHgjrSO1R7mXA /026J60WbMQkRvJKCkGehlybhzZ0N7bexhWamy74Wo303V0aIcA4ArQ05p45FpZ8aaY5 r1fQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1696000612; x=1696605412; h=to:subject:message-id:date:from:mime-version:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=sF7UWYtQkK4JO9GUfAR47Wy7KWztM2qiywyKsJRSNkY=; b=L3EFFPoLpZ1IZzjJUF1Q91wF8qi8+JxT206UPyxsH6mHvXE3Tt8CyMdqvb9gjA/f3Q jWO0hiirL+4ofjTezPSYE61gEvW1BNg1ZOmXPWHfQQWF6/WeDXSSwOTJ+hWy/qoS3u4M OtvZ/T5yWINz8nOU9TfC/+veDEMaP56xAtRxlRRummcshyLcZwYCZ2maepHqHCzyfZJr 1WeS5hFa0JPY0+OeTV/7wLbwiQsjeXOEHUl6Ve/uQOkydkqcyup6DfHXetlvxNLWQ62v o1Ig7BGerVtRMwMHhfFZb0C4jwdd1giFka7+aPgJyXAsccV4e228UGsAYCPLrWw+R8wA QNJQ== X-Gm-Message-State: AOJu0YwHX6IIINas+P7N+TmS2+3iF+kp1XbK+ImJVJ9G36BzDz/OnX4j tvL6Pu6TUjqQIlwT5lgyhgXDAIK3cb7FA9DCsqnMXrChq+E= X-Google-Smtp-Source: AGHT+IHi+wNcyv7OGDxe1DOCGKDl8+wkorYVPV693p5k4MX7zONKoMWF1nxlTJRoWT2S05+O6Ugvama+lSt0IeQ21ks= X-Received: by 2002:a0d:ebca:0:b0:59b:a2a:2131 with SMTP id u193-20020a0debca000000b0059b0a2a2131mr4747429ywe.31.1696000612580; Fri, 29 Sep 2023 08:16:52 -0700 (PDT) MIME-Version: 1.0 From: "H.J. Lu" Date: Fri, 29 Sep 2023 08:16:16 -0700 Message-ID: Subject: [RFC] DT_X86_64_PLT* dependency To: GNU C Library Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-3015.8 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 autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: Hi, I checked in a linker patch: https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=832ca732b8a96ff9a3e7c4abf24098bf2a59a96d to generate DT_X86_64_PLT, DT_X86_64_PLTSZ and DT_X86_64_PLTENT for https://gitlab.com/x86-psABIs/x86-64-ABI/-/commit/6d824a52a42d173eb838b879616c1be5870b593e When these tags are generated, the r_addend field of the R_X86_64_JUMP_SLOT relocation stores the offset of the indirect branch instruction. However, glibc versions which don't have this commit in glibc 2.36: commit f8587a61892cbafd98ce599131bf4f103466f084 Author: H.J. Lu Date: Fri May 20 19:21:48 2022 -0700 x86-64: Ignore r_addend for R_X86_64_GLOB_DAT/R_X86_64_JUMP_SLOT According to x86-64 psABI, r_addend should be ignored for R_X86_64_GLOB_DAT and R_X86_64_JUMP_SLOT. Since linkers always set their r_addends to 0, we can ignore their r_addends. Reviewed-by: Fangrui Song won't ignore the r_addend value in the R_X86_64_JUMP_SLOT relocation. Such binaries will fail to run with these versions of glibc. I am working on a linker patch to add a glibc version dependency similar to GLIBC_ABI_DT_RELR for DT_RELR. Although this commit has been backported to glibc 2.33/2.34/2.35 release branches, there may be 2.33/2.34/2.35 glibc binaries without the fix. Should binaries with DT_X86_64_PLT tags depend on glibc 2.36 or 2.33? Thanks. -- H.J.