From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-ej1-f46.google.com (mail-ej1-f46.google.com [209.85.218.46]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 9A8D53AB5B8 for ; Tue, 28 Jul 2026 12:43:07 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.218.46 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785242589; cv=none; b=rPTNc4TmXWZVeXOcMlDvjIIiTPiG3wT2wOi54zXMrV2YqmIFNVjpWAbZFpulxBGmtjTw5b86YGYD9HaLjKdouy4Nl/F2noQ/a3bUgk+jgH1Art50USjlZiLpWC3EMbvtBvlWSvLzAP12289hY2NtYy3r4aLVEsKauxQDNf5NCgg= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785242589; c=relaxed/simple; bh=+I542TCyEiR2dkdc/EjJMpQVyAenOURWCaveKVfQk5U=; h=From:Subject:Date:Message-Id:MIME-Version:Content-Type:To:Cc; b=EKAX06hcZjslc8NJ6BLDOr+IX1OsKQFSQjMlSNiozuCMoAqm62+8AK/VFPxKijCZK1UGB/Dkb7YmOM07yD/LoHfkf0gc5eZA1SVE2XR2AyONt+2fiW5dqaHr9JAoaK3Dz9pBc7Ofht5i+gWujJ12izYlALcBPYmA/Z1/SD/KS8A= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=fOEwYyTS; arc=none smtp.client-ip=209.85.218.46 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="fOEwYyTS" Received: by mail-ej1-f46.google.com with SMTP id a640c23a62f3a-c160420289bso496645266b.0 for ; Tue, 28 Jul 2026 05:43:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1785242586; x=1785847386; darn=vger.kernel.org; h=cc:to:content-transfer-encoding:content-type:mime-version :message-id:date:subject:from:from:to:cc:subject:date:message-id :reply-to:content-type; bh=fD4Ka0zrPbVAg4KYEq8UyY0zj2IasFwu7KBSI8jg6EM=; b=fOEwYyTSwntIMbmpNZ9dr72rIj35P1rw9BIpPPHbhkCk8EkiGd/NPCLNyDx7lIn4F1 PXbDcWC+7UNAXarBNbdDuHts+GQDdDQb+hEQpKo46snu0Q+uw0arvRZTnWsGElWknXDo GOv1DplO0IoHtm2FsyukSVPsCEeuUjmDhtoFoqn6OJoQBRjuy6omCsFpuzJGlTrzpUTK D1AaIjvok5D7oj/TfwrlBPAmgDZT8VSQidhwgFS3cVI86EjIo5N0EGXgcLlogZuQrexB sewOHlUodBFdv25ndVoff5NRpS8tX3ZB/5OQry8gIKNPxbi4QN5GuB0W9lO+dFp/aD6l PSkQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1785242586; x=1785847386; h=cc:to:content-transfer-encoding:content-type:mime-version :message-id:date:subject:from:x-gm-gg:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to:content-type; bh=fD4Ka0zrPbVAg4KYEq8UyY0zj2IasFwu7KBSI8jg6EM=; b=VnWDBTamg8G7Q/f7p5QZTBON8ISNn+jI4j8aVeUEdGJqRoroLbLvepmEJaoHAhxKIe LHDQMIsWrQUO5HCJBXnNhtzl1F8qI2KnekueygEVpti7ESHTSX+27AALV4+v/lRnD6YK XQpUzm2n6dvpINHrldjeVEMsD0cL/ZQK8oJ2o+GC2cQKoELV8cv4buZ11GbhJBNF3QcG iv6JErwkjXbMIb++JRHVOqUr8WtHjgfSrjkYCaL+iT7Gftb/gXn9G+Kkfw4jnkV+gW6b Mj3h9+MPq2Fhu4eFeiBdeKstLlVJGOxOEN1MSPCKRNpqLBFnPMyjFUo62vkX2uzss39/ yA/A== X-Forwarded-Encrypted: i=1; AHgh+RqbSakNkngkCGK8j79cr0a6iMrHIfP/iI+/+Fhe21J3A0rrk3LNxfedn13b560xmTWWixsL4cg5vEijQBI=@vger.kernel.org X-Gm-Message-State: AOJu0Yyjdrek708woN42p7E3qzKb3ATLyOEyB9WdGGWGpnSZtAQ5kpdf LOi5hLCmfhFx2+9pOOn4SCTElCFNG0byH3XuC+IFH9gEUgL53M+jrvEp1amWOxgTCjI= X-Gm-Gg: AR+sD12FIr4LCeB6+ZaU5ewRR7lEHFy5BhNjSEayAKXeaIkEBafYwhsu9jqO77eKDPn VMWdLJgUfanTm8UupSrp2gxXpePiqUn1IeNZqMlP1UeJ8SzPzcBjOJpinwhRIAfcNX1BWUlvEGy jATD/vpETLw1iG7/TgopLUtcw7cO4Jj/WvLxU7IdR1Qj7mdVsxJ3/SqU3NcUkg6d/of+s6t8kwF 9+NK3lOXVO8/Ka14Ab4qi73bFvoq3EnE0tawBrNW56qXssZz15orPHwsC804749l1jvSSqsxcrE VOG95tNgxphOgBzAEE85LafmjeMFbfo2FFk6k9TYO6VIDPFswxzgnc3UbdCWABC1GKe9sHBeIer 9ngL2Vo4lwHv60UtL517Ge/cLn+UapV2yFUAkqsHafkwQlHNHugZYUvwjs3NwADNlVo3Kxz82w2 VpMdP8eeCH9GjjFKAWzh4baNEoTAUNcq6xp3OMDEEviyEvKkmYCW/I/vhZyvPq+D87ow== X-Received: by 2002:a17:907:d113:b0:c12:5e26:da50 with SMTP id a640c23a62f3a-c1f7223e43amr112857566b.65.1785242585774; Tue, 28 Jul 2026 05:43:05 -0700 (PDT) Received: from puffmais2.c.googlers.com (150.230.32.34.bc.googleusercontent.com. [34.32.230.150]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-c1c32c902d2sm745805766b.34.2026.07.28.05.43.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 28 Jul 2026 05:43:04 -0700 (PDT) From: =?utf-8?q?Andr=C3=A9_Draszik?= Subject: [PATCH 0/2] kbuild: link-vmlinux.sh: more reliable 3rd pass linking Date: Tue, 28 Jul 2026 13:42:38 +0100 Message-Id: <20260728-linux-kallsyms-fix-v1-0-1a665156c898@linaro.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit X-B4-Tracking: v=1; b=H4sIAL6jaGoC/x2MSQqAMAwAvyI5G9C6+xXx4JJqsFZpUBTx7xaPM zDzgJBjEqiDBxydLLxZD3EYwDB3diLk0TOoSOVRoUo0bI8Ll84YuVdBzRdWGWmdVn2R9Qn4cHf k9T9t2vf9AII7pq5kAAAA X-Change-ID: 20260728-linux-kallsyms-fix-95eff49b75b3 To: Nathan Chancellor , Nicolas Schier , Nick Desaulniers , Bill Wendling , Justin Stitt Cc: Peter Griffin , Tudor Ambarus , Juan Yescas , Guenter Roeck , kernel-team@android.com, linux-kernel@vger.kernel.org, linux-kbuild@vger.kernel.org, llvm@lists.linux.dev, =?utf-8?q?Andr=C3=A9_Draszik?= X-Mailer: b4 0.14.3 link-vmlinux.sh currently only uses the file size of .tmp_vmlinux?.kallsyms.o to determine if it needs to do a third pass. I was hitting a case where file size didn't change, but symbols changed sufficiently to still move subsequent symbols in vmlinux to invalidate kallsyms. In particular kallsyms_names grew by one byte between .tmp_vmlinux1.kallsyms.o and .tmp_vmlinux2.kallsyms.o, moving the next symbol to the next alignment offset (4 bytes), moving many subsequent symbols in the final vmlinux image in turn (until abosrbed by further alignment instructions). This failed the final link with: Inconsistent kallsyms data Try "make KALLSYMS_EXTRA_PASS=1" as a workaround The two patches here are independent of each other: * Patch 2 in this series addresses the actual issue and also has a more detailed explanation with exact failure case * Patch 1 could be omitted if deemed useless, but I found it useful while debugging the issue. It just updates the kallsyms.c to instruct the assembler to also emit symbol sizes. Cheers, Andre' Signed-off-by: André Draszik --- André Draszik (2): kallsyms: add symbol size for kallsyms symbols that can change size kbuild: link-vmlinux.sh: improve detection of third pass requirement scripts/kallsyms.c | 4 ++++ scripts/link-vmlinux.sh | 20 +++++++++++++++++++- 2 files changed, 23 insertions(+), 1 deletion(-) --- base-commit: 0d33d21e47d9dc66f91e44da3fc9220c74d93df7 change-id: 20260728-linux-kallsyms-fix-95eff49b75b3 Best regards, -- André Draszik