From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id 2SSZFTzDK2ct8icAWB0awg (envelope-from ) for ; Wed, 06 Nov 2024 14:27:56 -0500 Authentication-Results: simark.ca; dkim=pass (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=cCzhkcN1; dkim-atps=neutral Received: by simark.ca (Postfix, from userid 112) id BA3CA1E5FB; Wed, 6 Nov 2024 14:27:55 -0500 (EST) X-Spam-Checker-Version: SpamAssassin 4.0.0 (2022-12-13) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-6.4 required=5.0 tests=ARC_SIGNED,ARC_VALID,BAYES_00, DKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED autolearn=ham autolearn_force=no version=4.0.0 Received: from server2.sourceware.org (server2.sourceware.org [8.43.85.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPS id 46AE21E5FC for ; Wed, 6 Nov 2024 14:27:51 -0500 (EST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id F392D3858283 for ; Wed, 6 Nov 2024 19:27:50 +0000 (GMT) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by sourceware.org (Postfix) with ESMTP id 3E48A3858D3C for ; Wed, 6 Nov 2024 19:26:16 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 3E48A3858D3C Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=redhat.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 3E48A3858D3C Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=170.10.129.124 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1730921185; cv=none; b=GRZofDWstMpdB64Se4YM2XXwf7bdJQNY2VqZQ6HbCELKG7YnOtUCzhrsUoseSuFoh05eNCSGeSvF9CSi5OZPONm6rtZ0QjfkzG6CF0GGYF8y8gSax+Kil8e2Q5NF79pr+GpedxwDQaZNa8Ia5Tnb1rDScHQow+cng92gfbqZZTc= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1730921185; c=relaxed/simple; bh=1a1lVP45oDwVNMziL3le9cHM9WfPdazlOj54/6ewM7I=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=V4pjf2gPOQuCdiuA+vy2VZCV/1Oqw1bG22ZzV+wlVD0dgyqGuvP95hN4WheOUuSDOLr17k1knoUTdLp3b0pZMNyr0fsilGN5HPl0/5HvNaOPpsmnHlkoz9XIHUK+5KBnDIUfjQfW0rHsSHfzyo9UlwXLnR9N/ylkv5eJW2J3AyM= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1730921176; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=/J7AJrLYKOfuFiKv47ry3kNrOQen9QeZj7OoeI+Efoo=; b=cCzhkcN1GGPc4FTf0u1tlEr3wni+UIccm3v6bbTNwWj86CrUmyi/8T1X+/s8T/Wsl/e/Rk jCDq9ON6IHqLxj0nHuvkQPLBaeEkmk5tDrcrcHP0gWVZFqKlG4Rzr89bILpy+AucrPTDgi nNwJd5D6Zx8FLZEt98AcxH12FUjeCkY= Received: from mx-prod-mc-03.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-269-zTpv07AuMr24adZKJ9IQmA-1; Wed, 06 Nov 2024 14:26:14 -0500 X-MC-Unique: zTpv07AuMr24adZKJ9IQmA-1 X-Mimecast-MFC-AGG-ID: zTpv07AuMr24adZKJ9IQmA Received: from mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.17]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id C16F719560B8 for ; Wed, 6 Nov 2024 19:26:13 +0000 (UTC) Received: from f41-1.lan (unknown [10.22.81.112]) by mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id E6A5B1955F41; Wed, 6 Nov 2024 19:26:12 +0000 (UTC) From: Kevin Buettner To: gdb-patches@sourceware.org Cc: Kevin Buettner Subject: [PATCH v4 07/11] Delete disabled i386 internal TLS support Date: Wed, 6 Nov 2024 12:21:43 -0700 Message-ID: <20241106192517.206988-8-kevinb@redhat.com> In-Reply-To: <20241106192517.206988-1-kevinb@redhat.com> References: <20241106192517.206988-1-kevinb@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.0 on 10.30.177.17 X-Mimecast-Spam-Score: 0 X-Mimecast-MFC-PROC-ID: 2aL08vXkTNhvHaKr6uacsGXQ05QxVxAeqAfRD9Ty2aw_1730921174 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset="US-ASCII"; x-default=true X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gdb-patches-bounces~public-inbox=simark.ca@sourceware.org As mentioned in the previous commit, this commit deletes the disabled code which could be used to implement internal TLS support for the i386 target. --- gdb/i386-linux-tdep.c | 44 ------------------------------------------- 1 file changed, 44 deletions(-) diff --git a/gdb/i386-linux-tdep.c b/gdb/i386-linux-tdep.c index 8e9ffe984a3..9dec83ac753 100644 --- a/gdb/i386-linux-tdep.c +++ b/gdb/i386-linux-tdep.c @@ -753,45 +753,6 @@ i386_linux_displaced_step_copy_insn (struct gdbarch *gdbarch, return closure_; } -#if 0 -/* Disabled because fetching I386_GSBASE_REGNUM causes an internal - error. */ - -/* Fetch and return the TLS DTV (dynamic thread vector) address for PTID. - Throw a suitable TLS error if something goes wrong. */ - -static CORE_ADDR -i386_linux_get_tls_dtv_addr (struct gdbarch *gdbarch, ptid_t ptid, - enum linux_libc libc) -{ - /* On i386, the thread pointer is found in the gsbase register. */ - regcache *regcache - = get_thread_arch_regcache (current_inferior (), ptid, gdbarch); - target_fetch_registers (regcache, I386_GSBASE_REGNUM); - ULONGEST gsbase; - if (regcache->cooked_read (I386_GSBASE_REGNUM, &gsbase) != REG_VALID) - throw_error (TLS_GENERIC_ERROR, _("Unable to fetch thread pointer")); - - /* The thread pointer (gsbase) points at the TCB (thread control - block). The first two members of this struct are both pointers, - where the first will be a pointer to the TCB (i.e. it points at - itself) and the second will be a pointer to the DTV (dynamic - thread vector). There are many other fields too, but the one - we care about here is the DTV pointer. Compute the address - of the DTV pointer, fetch it, and convert it to an address. */ - CORE_ADDR dtv_ptr_addr - = gsbase + gdbarch_ptr_bit (gdbarch) / TARGET_CHAR_BIT; - gdb_byte buf[gdbarch_ptr_bit (gdbarch) / TARGET_CHAR_BIT]; - if (target_read_memory (dtv_ptr_addr, buf, sizeof buf) != 0) - throw_error (TLS_GENERIC_ERROR, _("Unable to fetch DTV address")); - - const struct builtin_type *builtin = builtin_type (gdbarch); - CORE_ADDR dtv_addr = gdbarch_pointer_to_address - (gdbarch, builtin->builtin_data_ptr, buf); - return dtv_addr; -} -#endif - static void i386_linux_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch) { @@ -1027,11 +988,6 @@ i386_linux_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch) /* Enable TLS support. */ set_gdbarch_fetch_tls_load_module_address (gdbarch, svr4_fetch_objfile_link_map); -#if 0 - set_gdbarch_get_thread_local_address (gdbarch, - linux_get_thread_local_address); - linux_register_tls_methods (info, gdbarch, i386_linux_get_tls_dtv_addr); -#endif /* Core file support. */ set_gdbarch_iterate_over_regset_sections -- 2.46.2