From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from omta38.uswest2.a.cloudfilter.net (omta38.uswest2.a.cloudfilter.net [35.89.44.37]) by sourceware.org (Postfix) with ESMTPS id D0491385E009 for ; Sat, 9 Mar 2024 01:12:38 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org D0491385E009 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=tromey.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=tromey.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org D0491385E009 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=35.89.44.37 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1709946760; cv=none; b=vxTygFrquIO5+iDFxVOwmSueuA+Z3S149+s0QKsg+mhgL/dY5I6CEmlW8hNAmsWe4HPBJFtJs26chgnKp1IwifrY7fE+es7k+c5Kq+ftCBsS9bfeJfeAIPaMetghbJfA6rSwuCNgZgMSXr9D/tcjgjG2CZYDyUkwsC6FE3QPAiA= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1709946760; c=relaxed/simple; bh=Wj1sD7/FqrBRiVZYiED0T0RJibjZz8z1Eoxm/0gRX70=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=QX1HSn2cOha++0fNv050qOQ768Q6Wk0x+qC3chwB3V7g1DCcTkEb48P+H6Ei2GsbtfFiwNurCP6BWWNcCJoLeavGsE6rdFiVHjuwblY3mKoFDmyxd10P1Ntf4cAaqlwrxqkSlvFcYID2bPQhU6qlBXH9YkjK8t3xlPNpPKenQQQ= ARC-Authentication-Results: i=1; server2.sourceware.org Received: from eig-obgw-5007a.ext.cloudfilter.net ([10.0.29.141]) by cmsmtp with ESMTPS id iVwzroLO3DI6filGPr78Fd; Sat, 09 Mar 2024 01:12:37 +0000 Received: from box5379.bluehost.com ([162.241.216.53]) by cmsmtp with ESMTPS id ilGOrmlBDOvndilGOrTGm1; Sat, 09 Mar 2024 01:12:37 +0000 X-Authority-Analysis: v=2.4 cv=aa1nnwot c=1 sm=1 tr=0 ts=65ebb785 a=ApxJNpeYhEAb1aAlGBBbmA==:117 a=ApxJNpeYhEAb1aAlGBBbmA==:17 a=K6JAEmCyrfEA:10 a=Qbun_eYptAEA:10 a=zstS-IiYAAAA:8 a=dQ-2SktXYtBlvChFjvUA:9 a=4G6NA9xxw8l3yy4pmD5M:22 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=tromey.com; s=default; h=Content-Type:MIME-Version:Message-ID:In-Reply-To:Date:References :Subject:Cc:To:From:Sender:Reply-To:Content-Transfer-Encoding:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=+m57ASqz4C3tq6z94AB2uD5GjEJiBTaucNnAIN73KQs=; b=XFmNpU+d3W+0ZMdxxzGX6rp+SO sLmHytdbQEVfVQrAxe2WYouGL0lHX7LHBulm1jeeAs3uwhXw/xh5S4OWTZYt8VJCT/Jnbrbn6rzPD JLMVjnaTD/7mizA9Wo+3+UdkH; Received: from [161.98.8.3] (port=38444 helo=prentzel) by box5379.bluehost.com with esmtpsa (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96.2) (envelope-from ) id 1rilGO-002BUp-0i; Fri, 08 Mar 2024 18:12:36 -0700 From: Tom Tromey To: Tom Tromey Cc: Nick Clifton , binutils@sourceware.org Subject: Re: [PATCH 1/3] Make several more BFD globals thread-local References: <20240130010540.1754740-1-tom@tromey.com> <20240130010540.1754740-2-tom@tromey.com> <87sf1xjj62.fsf@tromey.com> <87bk8ljh31.fsf@tromey.com> X-Attribution: Tom Date: Fri, 08 Mar 2024 18:12:34 -0700 In-Reply-To: <87bk8ljh31.fsf@tromey.com> (Tom Tromey's message of "Mon, 12 Feb 2024 18:20:02 -0700") Message-ID: <87y1asxl6l.fsf@tromey.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.3 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - box5379.bluehost.com X-AntiAbuse: Original Domain - sourceware.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - tromey.com X-BWhitelist: no X-Source-IP: 161.98.8.3 X-Source-L: No X-Exim-ID: 1rilGO-002BUp-0i X-Source: X-Source-Args: X-Source-Dir: X-Source-Sender: (prentzel) [161.98.8.3]:38444 X-Source-Auth: tom+tromey.com X-Email-Count: 2 X-Org: HG=bhshared;ORG=bluehost; X-Source-Cap: ZWx5bnJvYmk7ZWx5bnJvYmk7Ym94NTM3OS5ibHVlaG9zdC5jb20= X-Local-Domain: yes X-CMAE-Envelope: MS4xfLCEA+Fpgbj9B7fJTR+lCledEIEyhpjFsO8Lo3MtD9LYp91Mue8SIjkLb0RSzMRAKDPldoVjAuBiC0PU5y1RHml6I/LwajoKnpumJx71GRjFBgZA3ZjR N7c9Iml3dbczu9GWCx4wXiB6kDQYXH9EUh34OpEt5Ai6V7eBIWbzO9I0oUwLp9OhTUPV9JF8wbB8gpEyUbdeGbtFuNPJE2fkauk= X-Spam-Status: No, score=-3015.8 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,JMQ_SPF_NEUTRAL,SPF_HELO_NONE,SPF_PASS,TXREP,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: >>>>> "Tom" == Tom Tromey writes: Tom> What I meant when I wrote the above is that basically there are two sets Tom> of globals to consider in this patch: the ones related to error emission Tom> (_bfd_error_internal and error_handler_bfd), and then the other ones Tom> related to the caching error message code (per_xvec_warn, Tom> in_check_format). Tom> I thought that making the latter ones thread-local felt hackish, because Tom> they could somewhat easily be attributes of a BFD and not globals at Tom> all. Tom> I took a stab at some of this tonight and discovered that since Tom> in_check_format is only used by the error-reporting code, it can be Tom> combined with the other flag. Tom> I've appended a rough draft of this. Tom> I haven't tackled the xvec stuff yet. I looked into this problem this evening and I found out that the per-xvec errors are also only used from inside bfd_check_format_matches. A (thread-local) global would still be needed, because warnings aren't emitted "per-BFD" -- but it could just replace error_handler_bfd, leaving just a single global. I haven't implemented this but I plan to try it soon. This is one of the issues blocking GDB 15. Tom> Also I think it'd be good if print_warnmsg re-emitted the errors using Tom> _bfd_error_handler. This would let gdb print them the way it likes. Tom> However... that's a change to semantics so I don't know if that's OK or Tom> whether another error emitter is required. I guess I don't really know Tom> how to provoke one of these messages and when they would matter. Like, Tom> I see that ldmain.c installs an error handler -- is it intentional that Tom> this be bypassed by errors occurring in bfd_check_format_matches? I'd appreciate some insight into this. thanks, Tom