| Message ID | 20261102225947.1725-4-oleg.tolmatcev@gmail.com |
|---|---|
| State | New |
| Headers |
Return-Path: <binutils-bounces~patchwork=sourceware.org@sourceware.org> X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from vm01.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 0CA8E4BB5880 for <patchwork@sourceware.org>; Mon, 2 Nov 2026 23:01:25 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 0CA8E4BB5880 Authentication-Results: sourceware.org; dkim=pass (2048-bit key, unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20260707 header.b=h41+BU7H X-Original-To: binutils@sourceware.org Delivered-To: binutils@sourceware.org Received: from mail-wr1-x436.google.com (mail-wr1-x436.google.com [IPv6:2a00:1450:4864:20::436]) by sourceware.org (Postfix) with ESMTPS id 31C374B99F56 for <binutils@sourceware.org>; Mon, 2 Nov 2026 23:00:38 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 31C374B99F56 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gmail.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 31C374B99F56 Authentication-Results: sourceware.org; arc=none smtp.remote-ip=2a00:1450:4864:20::436 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1793660438; cv=none; b=pRcNxeAdYIhFkyMTvhIoi/ca4+qYC4s1vuR1pCfvqol9UnhjEY5ARDG2sebpJDohcTEy7wcI/XBfRmti6zwY46jPh4ymggSUhHen3INhiqBCInTx9RCyRWrjyfEmBkUZg0se3kHC2hLYH7iX0A8zXh1DpZaRBHLRGzqZLQpXZZg= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1793660438; c=relaxed/simple; bh=UktN6pZRuGG1rv4qSdJbEwElUDVeHkwF8ixV9glZQEQ=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=x1Fq2C1uIB5KEXp7EZ+/4+pYf5USiNLO3W7OhySfHudTYfgiiCrbqiGSyqNkCVILf3c5446mMf9p6hiQMZ1uApgEsYF7RkLaGpKCQ4BhhAcP3JG1Mm4mnnJR49Q7k6UFuPl7g3NfYHWbXfPvia5X0LPs8vx4A0auvtyKA9OHUfs= ARC-Authentication-Results: i=1; sourceware.org; dkim=pass (2048-bit key, unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20260707 header.b=h41+BU7H DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 31C374B99F56 Received: by mail-wr1-x436.google.com with SMTP id ffacd0b85a97d-48dee593f18so3401366f8f.3 for <binutils@sourceware.org>; Mon, 02 Nov 2026 15:00:38 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20260707; t=1793660437; x=1794265237; darn=sourceware.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to:content-type; bh=/fwDhCUNSXQO0b2/d4UdFFPoUrTlbwgwGY+QWuEfkjE=; b=h41+BU7HxHZhoEl1Hrgl8hMaUY2+zf0Eq2Ud3mJCoLomy2NcfkqzKGrqWJYy/GexbY fAqkTvzw2JJKEXWk1xrn+jY6vncfeKDdTcEkmd4UGmAp9RLppzygVtCxi/JV0gzEgDRG nWnWs6rYwCoLzbKC9iXO3uadIhh8pJukch0CLsYjctinWGi0yEGdZpAKQQGFmtF7F++F xpK3xIcQ2mwkWCNIedoEWpFJxz682mNIRPIQ01ZaxLmWxoEVNHlRh4iTU82lywYSkngQ vxYZ6QLcaIrbXs2Z04llNp8TdaInmtwht2AZjuvkXesqzsekFTc6KrKDJwzzl8RrAlXT qztw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1793660437; x=1794265237; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to:content-type; bh=/fwDhCUNSXQO0b2/d4UdFFPoUrTlbwgwGY+QWuEfkjE=; b=EBQviUJIsCDIcxXRjHD3W2Sjny34ZQy39TupU7owRo9lUmMEQ9gROAtsBUKzycCPOY XEagI1el430q35VvUeLDbCDkFNYd7up6j0vDKkxCepiqDFGG/QZHEgVWBdwwM1F7z3WE T+dMh2JaEYTN1AzyKuTu5qfbYR1wQsAUsthumx9y6TwuEOMjjGj4g6P2xzO79KUSXmXz wG7onRAa/oKeSW9UluIAjdh/47GBFgfTzcpIV/iwkUwaYA7pKTcBAOUwOHQ9QLJuIZau q0yeBRnrlKtdQDEqS0Em6FqRj1dUAVrJZuptO1/v2143xbrqlTiRXR5qikL6lDxmhlYP UKvA== X-Gm-Message-State: APuU4Z+V01f7Qi+6vFJ1NCs240vArVEyV7z+FHGMtL+7OcJrUZy/CBYk NnoWaiuDqcQuHJDqZnklEbxIW8qyJrOCfaPuTexN4C2Ws26C2AT7Rce6Nhso6w== X-Gm-Gg: AYBFou1Tj1G2RAnHU2lj7H0X4FoFTge95sGkiMGWHBbCrvY2IUjmJmR3l/JkCcb8/nk fQirdvU5++76dECDp08NV0YkJxYCatoEIyxNbEvUcGM0EE1KbHKEL7ZrugYjPXdeWfSDz5Fib8/ NgOiKMiy1SSqDd5nlGK/ZT+SeJ3cZlG0hewJ9/8HB5NyBdzWxL2XCshclVQfuOO9ACbsknaT+hF NXokh5zwJjfLiitGDsnLF6tFWkVgHYsLSWUF1Qc/xQt6ueDS22uJS5XjxDpO79kACiSY+PG9qGV gsW/59Wt9q5tFhoUEDxVtCycC9a9LwOOf4aODggT6cNLzbQtCy9F6H5T+2yTPBFOJh9vr0iMymL LOVSf0i8Rx7gv6T+DTne1nCQbta52P4MIR5H9rzIkheJfju+1/2Tihfo2bP/s+PzxiNkPzcA78C 9xLIvHwJ9+tdoQiKOl6J/wn2CFxLFKmM9liU6405qNUF5jLr8u6CXDQUiuEir44dovbXeOdWPQv hHgEyIOl1DLTdLVyYJ3V5W7VCJhsHu7I2SX5B0ftafIXQQWGK4fwml99g2Xs2LSxbKPeEB8Bsbc 0kBGwpSf1y4GgzP9UOAdLvaNIlFMaeHrnhqC8HcVJPwB7t7kcS1zDhjv8Qids3nCo6KcDvxOFzC 8/iipqp2qF8YQ4FT+675nxA== X-Received: by 2002:a05:6000:1608:b0:48b:118e:7454 with SMTP id ffacd0b85a97d-48e6e2efd4cmr18855831f8f.31.1793660437042; Mon, 02 Nov 2026 15:00:37 -0800 (PST) Received: from Mein-PC (p200300ed8f274c00edef5ac00064aca9.dip0.t-ipconnect.de. [2003:ed:8f27:4c00:edef:5ac0:64:aca9]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-48e71ba24f6sm22626729f8f.51.2026.11.02.15.00.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 02 Nov 2026 15:00:36 -0800 (PST) From: Oleg Tolmatcev <oleg.tolmatcev@gmail.com> To: binutils@sourceware.org Cc: Oleg Tolmatcev <oleg.tolmatcev@gmail.com> Subject: [PATCH] ld/pdb: Skip auxiliary symbol entries in handle_debugs_section Date: Mon, 2 Nov 2026 23:59:44 +0100 Message-ID: <20261102225947.1725-4-oleg.tolmatcev@gmail.com> X-Mailer: git-send-email 2.56.0.windows.1 In-Reply-To: <20261102225947.1725-2-oleg.tolmatcev@gmail.com> References: <20261102225947.1725-2-oleg.tolmatcev@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-11.3 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, RCVD_IN_PBL, SPF_HELO_NONE, SPF_PASS, TXREP shortcircuit=no autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on sourceware.org X-BeenThere: binutils@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Binutils mailing list <binutils.sourceware.org> List-Unsubscribe: <https://sourceware.org/mailman/options/binutils>, <mailto:binutils-request@sourceware.org?subject=unsubscribe> List-Archive: <https://sourceware.org/pipermail/binutils/> List-Post: <mailto:binutils@sourceware.org> List-Help: <mailto:binutils-request@sourceware.org?subject=help> List-Subscribe: <https://sourceware.org/mailman/listinfo/binutils>, <mailto:binutils-request@sourceware.org?subject=subscribe> Errors-To: binutils-bounces~patchwork=sourceware.org@sourceware.org |
| Series |
ld/pdb: Skip auxiliary symbol entries in handle_debugs_section
|
|
Checks
| Context | Check | Description |
|---|---|---|
| linaro-tcwg-bot/tcwg_binutils_build--master-arm | fail | Patch failed to apply |
| linaro-tcwg-bot/tcwg_binutils_build--master-aarch64 | fail | Patch failed to apply |
Commit Message
Oleg Tolmatcev
Nov. 2, 2026, 10:59 p.m. UTC
handle_debugs_section treated every raw symbol table entry, including auxiliary entries, as a symbol and looked up a section for its n_scnum. In auxiliary entries that field holds unrelated data, so the lookup often missed and fell back to a linear scan over all sections. With objects containing thousands of sections this took about 10% of the link time for a large executable with --pdb. ld/ * pdb.c (handle_debugs_section): Skip auxiliary symbol entries. --- ld/pdb.c | 1 + 1 file changed, 1 insertion(+)
Comments
On 02.11.2026 23:59, Oleg Tolmatcev wrote: > handle_debugs_section treated every raw symbol table entry, including > auxiliary entries, as a symbol and looked up a section for its n_scnum. > In auxiliary entries that field holds unrelated data, so the lookup > often missed and fell back to a linear scan over all sections. With > objects containing thousands of sections this took about 10% of the > link time for a large executable with --pdb. > > ld/ > * pdb.c (handle_debugs_section): Skip auxiliary symbol entries. Okay, with one nit: > --- a/ld/pdb.c > +++ b/ld/pdb.c > @@ -1956,6 +1956,7 @@ handle_debugs_section (asection *s, bfd *mod, struct string_table *strings, > bfd_coff_swap_sym_in (mod, &ext[i], &symbols[i]); > if (symbols[i].n_scnum > 0) > sectlist[i] = coff_section_from_bfd_index (mod, symbols[i].n_scnum); > + i += symbols[i].n_numaux; > } As we're adding more stuff there, separating blank lines will become helpful. I'll add one in patch 1 and another one here. Jan
diff --git a/ld/pdb.c b/ld/pdb.c index b940c509de1..29c58306b4a 100644 --- a/ld/pdb.c +++ b/ld/pdb.c @@ -1956,6 +1956,7 @@ handle_debugs_section (asection *s, bfd *mod, struct string_table *strings, bfd_coff_swap_sym_in (mod, &ext[i], &symbols[i]); if (symbols[i].n_scnum > 0) sectlist[i] = coff_section_from_bfd_index (mod, symbols[i].n_scnum); + i += symbols[i].n_numaux; } if (!bfd_coff_relocate_section (abfd, coff_data (abfd)->link_info, mod,