From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id eQAmBycHYGnNITMAWB0awg (envelope-from ) for ; Thu, 08 Jan 2026 14:36:07 -0500 Received: by simark.ca (Postfix, from userid 112) id 11F071E0BC; Thu, 08 Jan 2026 14:36:07 -0500 (EST) X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-25) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-2.3 required=5.0 tests=ARC_SIGNED,ARC_VALID,BAYES_00, MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED, RCVD_IN_VALIDITY_CERTIFIED_BLOCKED,RCVD_IN_VALIDITY_RPBL_BLOCKED, RCVD_IN_VALIDITY_SAFE_BLOCKED autolearn=ham autolearn_force=no version=4.0.1 Received: from vm01.sourceware.org (vm01.sourceware.org [38.145.34.32]) (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 C83511E08D for ; Thu, 08 Jan 2026 14:36:05 -0500 (EST) Received: from vm01.sourceware.org (localhost [127.0.0.1]) by sourceware.org (Postfix) with ESMTP id 5BC344BA2E27 for ; Thu, 8 Jan 2026 19:36:05 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 5BC344BA2E27 Received: from simark.ca (simark.ca [158.69.221.121]) by sourceware.org (Postfix) with ESMTPS id 981A84BA2E06 for ; Thu, 8 Jan 2026 19:35:09 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 981A84BA2E06 Authentication-Results: sourceware.org; dmarc=fail (p=none dis=none) header.from=efficios.com Authentication-Results: sourceware.org; spf=fail smtp.mailfrom=efficios.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 981A84BA2E06 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=158.69.221.121 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1767900909; cv=none; b=iTJ9f0UtRHAp0IFs8JjWsxvSddxsWt4m5z7/ndJoSzMGbpak+/Mh22BI1W1MXcmw1Ei6mJg5+Gro66ur3U44VmvU4Ech1T34++URb5gYcXGD2OBfQYBR/X1vfcDjvUTg8OnCAuc6u0hKIwHiQcLxkoOhXyLhvWnV0oY9pVbUOo0= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1767900909; c=relaxed/simple; bh=A4yWBWH+QVgfnzDocMMcQASYkZbg9/wookcACfI9Fn8=; h=From:To:Subject:Date:Message-ID:MIME-Version; b=Zj31fTSSuxsEKYYutKyPxwD9e4VHbSB03qWZ7G93XCCjYBA0Psymr4ZzZZYRFLmwxssJP5Qsgb1X+begGvvQ64O8vK5dg72FZNwZbTSz2/WLEDfb96iTWsDDXmwEjANhVZvSLSgFR3skDVEY4wFbnXk+t6bCIE4tfhXBJn+0xc8= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 981A84BA2E06 Received: by simark.ca (Postfix) id 2E3201E0B3; Thu, 08 Jan 2026 14:35:09 -0500 (EST) From: Simon Marchi To: gdb-patches@sourceware.org Cc: Simon Marchi Subject: [PATCH 1/8] gdb/xcoffread: remove name computation Date: Thu, 8 Jan 2026 14:33:19 -0500 Message-ID: <20260108193507.553779-2-simon.marchi@efficios.com> X-Mailer: git-send-email 2.52.0 In-Reply-To: <20260108193507.553779-1-simon.marchi@efficios.com> References: <20260108193507.553779-1-simon.marchi@efficios.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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 It is no longer necessary to get names of symbols. The only thing we are interested in is the symbol to get the TOC offset, for which the name doesn't matter. Change-Id: I47e6009ed7600ea9c412fb25ed21a295cd0fec49 --- gdb/xcoffread.c | 40 +++++----------------------------------- 1 file changed, 5 insertions(+), 35 deletions(-) diff --git a/gdb/xcoffread.c b/gdb/xcoffread.c index ef78a4c9e594..d46b4eb23f3d 100644 --- a/gdb/xcoffread.c +++ b/gdb/xcoffread.c @@ -38,9 +38,6 @@ struct xcoff_symfile_info { - /* Pointer to the string table. */ - char *strtbl = nullptr; - /* Pointer to debug section. */ char *debugsec = nullptr; @@ -141,40 +138,15 @@ xcoff_symfile_init (struct objfile *objfile) xcoff_objfile_data_key.emplace (objfile); } -/* Swap raw symbol at *RAW and put the name in *NAME, the symbol in - *SYMBOL, the first auxent in *AUX. Advance *RAW and *SYMNUMP over - the symbol and its auxents. */ +/* Swap raw symbol at *RAW. Put the symbol in *SYMBOL and the first auxent in + *AUX. Advance *RAW and *SYMNUMP over the symbol and its auxents. */ static void swap_sym (struct internal_syment *symbol, union internal_auxent *aux, - const char **name, char **raw, unsigned int *symnump, - struct objfile *objfile) + char **raw, unsigned int *symnump, struct objfile *objfile) { bfd_coff_swap_sym_in (objfile->obfd.get (), *raw, symbol); - if (symbol->n_zeroes) - { - /* If it's exactly E_SYMNMLEN characters long it isn't - '\0'-terminated. */ - if (symbol->n_name[E_SYMNMLEN - 1] != '\0') - { - /* FIXME: wastes memory for symbols which we don't end up putting - into the minimal symbols. */ - *name = obstack_strndup (&objfile->objfile_obstack, - symbol->n_name, E_SYMNMLEN); - } - else - /* Point to the unswapped name as that persists as long as the - objfile does. */ - *name = ((struct external_syment *) *raw)->e.e_name; - } - else if (symbol->n_sclass & 0x80) - { - *name = XCOFF_DATA (objfile)->debugsec + symbol->n_offset; - } - else - { - *name = XCOFF_DATA (objfile)->strtbl + symbol->n_offset; - } + ++*symnump; *raw += coff_data (objfile->obfd)->local_symesz; if (symbol->n_numaux > 0) @@ -192,7 +164,6 @@ scan_xcoff_symtab (struct objfile *objfile) { CORE_ADDR toc_offset = 0; /* toc offset value in data section. */ - const char *namestring; bfd *abfd; asection *bfd_sect = nullptr; int ignored; @@ -224,8 +195,7 @@ scan_xcoff_symtab (struct objfile *objfile) /* The CSECT auxent--always the last auxent. */ union internal_auxent csect_aux; - swap_sym (&symbol, &main_aux[0], &namestring, &sraw_symbol, - &ssymnum, objfile); + swap_sym (&symbol, &main_aux[0], &sraw_symbol, &ssymnum, objfile); if (symbol.n_numaux > 1) { bfd_coff_swap_aux_in -- 2.52.0