From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from userp2120.oracle.com (userp2120.oracle.com [156.151.31.85]) by sourceware.org (Postfix) with ESMTPS id A69C93857C58 for ; Fri, 31 Jul 2020 19:16:26 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org A69C93857C58 Received: from pps.filterd (userp2120.oracle.com [127.0.0.1]) by userp2120.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 06VJ2cZj170437 for ; Fri, 31 Jul 2020 19:16:25 GMT Received: from userp3020.oracle.com (userp3020.oracle.com [156.151.31.79]) by userp2120.oracle.com with ESMTP id 32mf70334y-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL) for ; Fri, 31 Jul 2020 19:16:25 +0000 Received: from pps.filterd (userp3020.oracle.com [127.0.0.1]) by userp3020.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 06VJ2jXS058322 for ; Fri, 31 Jul 2020 19:16:25 GMT Received: from aserv0121.oracle.com (aserv0121.oracle.com [141.146.126.235]) by userp3020.oracle.com with ESMTP id 32mf70xhjt-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Fri, 31 Jul 2020 19:16:25 +0000 Received: from abhmp0009.oracle.com (abhmp0009.oracle.com [141.146.116.15]) by aserv0121.oracle.com (8.14.4/8.13.8) with ESMTP id 06VJGOTl009036 for ; Fri, 31 Jul 2020 19:16:24 GMT Received: from loom.srvr.nix (/81.187.191.129) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Fri, 31 Jul 2020 12:16:24 -0700 From: Nick Alcock To: binutils@sourceware.org Subject: [PATCH 0/3] libctf: error handling improvements Date: Fri, 31 Jul 2020 20:16:14 +0100 Message-Id: <20200731191617.148993-1-nick.alcock@oracle.com> X-Mailer: git-send-email 2.28.0.248.gcf383e60c9 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9699 signatures=668679 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 bulkscore=0 suspectscore=15 spamscore=0 mlxlogscore=999 adultscore=0 malwarescore=0 mlxscore=0 phishscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2006250000 definitions=main-2007310141 X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9699 signatures=668679 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 mlxscore=0 bulkscore=0 suspectscore=15 spamscore=0 impostorscore=0 clxscore=1015 phishscore=0 priorityscore=1501 adultscore=0 mlxlogscore=999 malwarescore=0 lowpriorityscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2006250000 definitions=main-2007310141 X-Spam-Status: No, score=-6.3 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, SPF_HELO_PASS, SPF_PASS, TXREP, UNPARSEABLE_RELAY autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: binutils@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Binutils mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 31 Jul 2020 19:16:47 -0000 This does two interconnected things, done simultaneously because each touches the same large set of source lines: gettextization, and transitioning of all dprintfs used for error and warning handling to use the new ctf_errwarning_next infrastructure added in the recent deduplicator series (which means changing a lot of dprintfs into ctf_err_warns -- and also, because I changed the prototype of ctf_err_warn, changing all the *existing* uses of that function, too). All three patches contain a few little things that need review: the first, a tiny reshuffling of readelf dependencies; the second, adaptation to a public API change (of ctf_errwarning_next, which hasn't yet landed in a release, so can change freely), some code motion allowing us to report CTF open errors, and a bit of error-text adjustment; and the third, the removal of quote marks around libctf API text in ld, objdump and readelf error messages, and adjustment of testsuite output to match. No new test failures, CTF-related test failures, or compilation warnings on anything in the test matrix (all-targets built and tested on x86_64-pc-linux-gnu, sparc64-unknown-linux-gnu, FreeBSD 12, Cygwin, mingw32, mingw64). (All tested both with --disable-nls and without it.) Nick Alcock (3): libctf, binutils: initial work towards libctf gettextization libctf, binutils, include, ld: gettextize and improve error handling binutils, ld: dequote libctf error messages binutils/Makefile.am | 2 +- binutils/Makefile.in | 2 +- binutils/objdump.c | 42 ++- binutils/readelf.c | 39 ++- include/ctf-api.h | 2 +- ld/ldlang.c | 67 ++-- ld/testsuite/ld-ctf/ctf.exp | 11 + ld/testsuite/ld-ctf/diag-ctf-version-f.d | 2 +- ld/testsuite/ld-ctf/diag-cttname-invalid.d | 2 +- .../ld-ctf/diag-decompression-failure.d | 2 +- ld/testsuite/ld-ctf/diag-parname.d | 2 +- ld/testsuite/ld-ctf/diag-unsupported-flag.d | 2 +- .../ld-ctf/diag-wrong-magic-number-mixed.d | 2 +- ld/testsuite/ld-ctf/diag-wrong-magic-number.d | 2 +- libctf/Makefile.am | 2 +- libctf/Makefile.in | 2 +- libctf/configure | 28 +- libctf/configure.ac | 2 +- libctf/ctf-archive.c | 63 ++-- libctf/ctf-create.c | 90 ++++-- libctf/ctf-dedup.c | 290 +++++++++--------- libctf/ctf-dump.c | 27 +- libctf/ctf-error.c | 4 +- libctf/ctf-impl.h | 18 +- libctf/ctf-intl.h | 68 ++++ libctf/ctf-labels.c | 6 +- libctf/ctf-link.c | 133 ++++---- libctf/ctf-open-bfd.c | 31 +- libctf/ctf-open.c | 59 ++-- libctf/ctf-string.c | 2 +- libctf/ctf-subr.c | 87 +++++- libctf/ctf-types.c | 3 +- 32 files changed, 646 insertions(+), 448 deletions(-) create mode 100644 libctf/ctf-intl.h -- 2.28.0.248.gcf383e60c9