From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp.gentoo.org (woodpecker.gentoo.org [140.211.166.183]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id BEC1C15827B for ; Tue, 19 Aug 2025 20:55:01 +0000 (UTC) Received: from lists.gentoo.org (bobolink.gentoo.org [140.211.166.189]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange x25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: relay-lists.gentoo.org@gentoo.org) by smtp.gentoo.org (Postfix) with ESMTPSA id 9ECC634239E for ; Tue, 19 Aug 2025 20:55:01 +0000 (UTC) Received: from bobolink.gentoo.org (localhost [127.0.0.1]) by bobolink.gentoo.org (Postfix) with ESMTP id 98802110280; Tue, 19 Aug 2025 20:55:00 +0000 (UTC) Received: from smtp.gentoo.org (woodpecker.gentoo.org [IPv6:2001:470:ea4a:1:5054:ff:fec7:86e4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange x25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by bobolink.gentoo.org (Postfix) with ESMTPS id 8CC75110280 for ; Tue, 19 Aug 2025 20:55:00 +0000 (UTC) Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange x25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 3A5A534239E for ; Tue, 19 Aug 2025 20:55:00 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 9FA6A322F for ; Tue, 19 Aug 2025 20:54:58 +0000 (UTC) From: "Sam James" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Sam James" Message-ID: <1755636866.07f1295681d48567dfc62dd15593cf57d4b240e5.sam@gentoo> Subject: [gentoo-commits] proj/toolchain/binutils-patches:master commit in: 9999/ X-VCS-Repository: proj/toolchain/binutils-patches X-VCS-Files: 9999/0007-x86-Add-GLIBC_ABI_GNU2_TLS-version-dependency.patch X-VCS-Directories: 9999/ X-VCS-Committer: sam X-VCS-Committer-Name: Sam James X-VCS-Revision: 07f1295681d48567dfc62dd15593cf57d4b240e5 X-VCS-Branch: master Date: Tue, 19 Aug 2025 20:54:58 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-Archives-Salt: f915c611-b2af-4177-96e8-30c7f8013802 X-Archives-Hash: b183e5bb701e76fe418e5b8c4bc7c25e commit: 07f1295681d48567dfc62dd15593cf57d4b240e5 Author: Sam James gentoo org> AuthorDate: Tue Aug 19 20:53:44 2025 +0000 Commit: Sam James gentoo org> CommitDate: Tue Aug 19 20:54:26 2025 +0000 URL: https://gitweb.gentoo.org/proj/toolchain/binutils-patches.git/commit/?id=07f12956 9999: refresh patch Signed-off-by: Sam James gentoo.org> ...Add-GLIBC_ABI_GNU2_TLS-version-dependency.patch | 56 ++++++++++++---------- 1 file changed, 32 insertions(+), 24 deletions(-) diff --git a/9999/0007-x86-Add-GLIBC_ABI_GNU2_TLS-version-dependency.patch b/9999/0007-x86-Add-GLIBC_ABI_GNU2_TLS-version-dependency.patch index 63b7fa1..4c33ef0 100644 --- a/9999/0007-x86-Add-GLIBC_ABI_GNU2_TLS-version-dependency.patch +++ b/9999/0007-x86-Add-GLIBC_ABI_GNU2_TLS-version-dependency.patch @@ -1,8 +1,7 @@ -From 40fd19259a3b9a576bedba9f9ce236d2f1b42da9 Mon Sep 17 00:00:00 2001 -Message-ID: <40fd19259a3b9a576bedba9f9ce236d2f1b42da9.1755548203.git.sam@gentoo.org> +From b6b200c936241a908de6d0c9e8c13db8cf16a31f Mon Sep 17 00:00:00 2001 From: "H.J. Lu" -Date: Mon, 18 Aug 2025 13:13:20 -0700 -Subject: [PATCH 1/3] x86: Add GLIBC_ABI_GNU2_TLS version dependency +Date: Fri, 4 Jul 2025 08:39:03 +0800 +Subject: [PATCH] x86: Add GLIBC_ABI_GNU2_TLS version dependency On Linux/x86, programs and shared libraries compiled with -mtls-dialect=gnu2 may fail silently at run-time against glibc without @@ -46,6 +45,8 @@ bfd/ (elf_x86_64_add_glibc_version_dependency): Add GLIBC_ABI_GNU2_TLS version dependency if GLIBC_ABI_GNU2_TLS dependency isn't disabled and has_tlsdesc_call isn't 0. + (elf_backend_add_glibc_version_dependency): Undef before CloudABI + support and redefine for elf32-x86-64. * elflink.c (elf_link_add_glibc_verneed): Changed to return bool. Remove the pointer to elf_find_verdep_info argument. Add a pointer to bool argument, auto_version. Return true if linked @@ -56,8 +57,6 @@ bfd/ bool argument and pass it to elf_link_add_glibc_verneed. (_bfd_elf_link_add_dt_relr_dependency): Pass NULL to _bfd_elf_link_add_glibc_version_dependency. - (elf_backend_add_glibc_version_dependency): Undef before CloudABI - support. * elfxx-x86.h (elf_x86_link_hash_table): Add has_tls_desc_call. ld/ @@ -109,7 +108,7 @@ Signed-off-by: H.J. Lu bfd/elf-bfd.h | 2 +- bfd/elf-linker-x86.h | 8 ++ bfd/elf32-i386.c | 44 ++++++++- - bfd/elf64-x86-64.c | 32 +++++-- + bfd/elf64-x86-64.c | 36 +++++-- bfd/elflink.c | 130 +++++++++++++++----------- bfd/elfxx-x86.h | 4 + ld/NEWS | 6 ++ @@ -142,7 +141,7 @@ Signed-off-by: H.J. Lu ld/testsuite/ld-x86-64/mark-plt-2.rd | 7 ++ ld/testsuite/ld-x86-64/mark-plt-2.s | 13 +++ ld/testsuite/ld-x86-64/x86-64.exp | 26 +++++- - 36 files changed, 592 insertions(+), 125 deletions(-) + 36 files changed, 596 insertions(+), 125 deletions(-) create mode 100644 ld/emultempl/elf-i386-glibc.em create mode 100644 ld/emultempl/elf-x86-64-glibc.em create mode 100644 ld/emultempl/elf-x86-64.em @@ -190,7 +189,7 @@ index 2c98257038f..fe322152e14 100644 unsigned int isa_level; diff --git a/bfd/elf32-i386.c b/bfd/elf32-i386.c -index abe26e476ff..c1115a52d1b 100644 +index b755b39ab55..9d06f1494cf 100644 --- a/bfd/elf32-i386.c +++ b/bfd/elf32-i386.c @@ -1687,6 +1687,10 @@ elf_i386_scan_relocs (bfd *abfd, @@ -273,7 +272,7 @@ index abe26e476ff..c1115a52d1b 100644 #undef TARGET_LITTLE_SYM diff --git a/bfd/elf64-x86-64.c b/bfd/elf64-x86-64.c -index b6f97b5b69b..edfa608d2d7 100644 +index b6fd466178e..1edce6e8703 100644 --- a/bfd/elf64-x86-64.c +++ b/bfd/elf64-x86-64.c @@ -2694,6 +2694,10 @@ elf_x86_64_scan_relocs (bfd *abfd, struct bfd_link_info *info, @@ -347,11 +346,22 @@ index b6f97b5b69b..edfa608d2d7 100644 /* CloudABI support. */ #undef TARGET_LITTLE_SYM +@@ -6479,6 +6499,10 @@ elf64_x86_64_copy_solaris_special_section_fields (const bfd *ibfd ATTRIBUTE_UNUS + #define elf_backend_bfd_from_remote_memory \ + _bfd_elf32_bfd_from_remote_memory + ++#undef elf_backend_add_glibc_version_dependency ++#define elf_backend_add_glibc_version_dependency \ ++ elf_x86_64_add_glibc_version_dependency ++ + #undef elf_backend_size_info + #define elf_backend_size_info \ + _bfd_elf32_size_info diff --git a/bfd/elflink.c b/bfd/elflink.c -index 7b0375406ac..ac40423751f 100644 +index f6c0c04e82e..d2c43f31bf5 100644 --- a/bfd/elflink.c +++ b/bfd/elflink.c -@@ -2283,68 +2283,85 @@ _bfd_elf_export_symbol (struct elf_link_hash_entry *h, void *data) +@@ -2281,68 +2281,85 @@ _bfd_elf_export_symbol (struct elf_link_hash_entry *h, void *data) return true; } @@ -480,7 +490,7 @@ index 7b0375406ac..ac40423751f 100644 } /* Skip if 2.GLIBC_MINOR_BASE includes VERSION_DEP. */ -@@ -2352,7 +2369,7 @@ elf_link_add_glibc_verneed (struct elf_find_verdep_info *rinfo, +@@ -2350,7 +2367,7 @@ elf_link_add_glibc_verneed (struct elf_find_verdep_info *rinfo, { minor_version = strtol (version_dep + 8, NULL, 10); if (minor_version <= *glibc_minor_base) @@ -489,7 +499,7 @@ index 7b0375406ac..ac40423751f 100644 } amt = sizeof *a; -@@ -2360,7 +2377,8 @@ elf_link_add_glibc_verneed (struct elf_find_verdep_info *rinfo, +@@ -2358,7 +2375,8 @@ elf_link_add_glibc_verneed (struct elf_find_verdep_info *rinfo, if (a == NULL) { rinfo->failed = true; @@ -499,7 +509,7 @@ index 7b0375406ac..ac40423751f 100644 } a->vna_nodename = version_dep; -@@ -2371,7 +2389,13 @@ elf_link_add_glibc_verneed (struct elf_find_verdep_info *rinfo, +@@ -2369,7 +2387,13 @@ elf_link_add_glibc_verneed (struct elf_find_verdep_info *rinfo, t->vn_auxptr = a; @@ -514,7 +524,7 @@ index 7b0375406ac..ac40423751f 100644 } /* Add VERSION_DEP to the list of version dependencies when linked -@@ -2380,19 +2404,19 @@ elf_link_add_glibc_verneed (struct elf_find_verdep_info *rinfo, +@@ -2378,19 +2402,19 @@ elf_link_add_glibc_verneed (struct elf_find_verdep_info *rinfo, void _bfd_elf_link_add_glibc_version_dependency (struct elf_find_verdep_info *rinfo, @@ -540,7 +550,7 @@ index 7b0375406ac..ac40423751f 100644 } while (*version_dep != NULL); } -@@ -2410,7 +2434,7 @@ _bfd_elf_link_add_dt_relr_dependency (struct elf_find_verdep_info *rinfo) +@@ -2408,7 +2432,7 @@ _bfd_elf_link_add_dt_relr_dependency (struct elf_find_verdep_info *rinfo) "GLIBC_ABI_DT_RELR", NULL }; @@ -1153,10 +1163,10 @@ index 413335ad765..0e13f7d8e35 100644 @cindex groups of archives @item -( @var{archives} -) diff --git a/ld/ldlex.h b/ld/ldlex.h -index 815da76a4c0..286ab0ba6d1 100644 +index d0c2e5d6db8..020712df0e7 100644 --- a/ld/ldlex.h +++ b/ld/ldlex.h -@@ -471,6 +471,9 @@ enum option_values +@@ -469,6 +469,9 @@ enum option_values OPTION_NO_LITERAL_MOVEMENT, OPTION_ABI_WINDOWED, OPTION_ABI_CALL0, @@ -1313,10 +1323,10 @@ index 00000000000..c816567c204 + ret + .section .note.GNU-stack,"",@progbits diff --git a/ld/testsuite/ld-x86-64/x86-64.exp b/ld/testsuite/ld-x86-64/x86-64.exp -index 6b86bc3d018..1b011451bcc 100644 +index a72a7da12c1..25480f70185 100644 --- a/ld/testsuite/ld-x86-64/x86-64.exp +++ b/ld/testsuite/ld-x86-64/x86-64.exp -@@ -2358,7 +2358,7 @@ run_dump_test "ibt-plt-3b-x32" +@@ -2360,7 +2360,7 @@ run_dump_test "ibt-plt-3b-x32" run_dump_test "ibt-plt-3c-x32" run_dump_test "ibt-plt-3d-x32" @@ -1325,7 +1335,7 @@ index 6b86bc3d018..1b011451bcc 100644 if { [istarget "x86_64-*-musl*"]} { set ASFLAGS "$saved_ASFLAGS" return -@@ -2384,6 +2384,30 @@ if { [check_compiler_available] } { +@@ -2386,6 +2386,30 @@ if { [check_compiler_available] } { {readelf {-W --version-info} mark-plt-1b.rd}} \ "mark-plt-1.so" \ ] \ @@ -1356,8 +1366,6 @@ index 6b86bc3d018..1b011451bcc 100644 ] } - -base-commit: b6ebe65cdac1afc15d5459318007be2d1d8832d0 -- 2.50.1