mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH 0/2] kbuild: link-vmlinux.sh: more reliable 3rd pass linking
@ 2026-07-28 12:42 André Draszik
  2026-07-28 12:42 ` [PATCH 1/2] kallsyms: add symbol size for kallsyms symbols that can change size André Draszik
                   ` (3 more replies)
  0 siblings, 4 replies; 8+ messages in thread
From: André Draszik @ 2026-07-28 12:42 UTC (permalink / raw)
  To: Nathan Chancellor, Nicolas Schier, Nick Desaulniers,
	Bill Wendling, Justin Stitt
  Cc: Peter Griffin, Tudor Ambarus, Juan Yescas, Guenter Roeck,
	kernel-team, linux-kernel, linux-kbuild, llvm,
	André Draszik

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 <andre.draszik@linaro.org>
---
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 <andre.draszik@linaro.org>


^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2026-08-24 13:47 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-07-28 12:42 [PATCH 0/2] kbuild: link-vmlinux.sh: more reliable 3rd pass linking André Draszik
2026-07-28 12:42 ` [PATCH 1/2] kallsyms: add symbol size for kallsyms symbols that can change size André Draszik
2026-08-24 12:26   ` Geert Uytterhoeven
2026-08-24 13:36     ` André Draszik
2026-08-24 13:47       ` Geert Uytterhoeven
2026-07-28 12:42 ` [PATCH 2/2] kbuild: link-vmlinux.sh: improve detection of third pass requirement André Draszik
2026-07-31 23:22 ` [PATCH 0/2] kbuild: link-vmlinux.sh: more reliable 3rd pass linking Nathan Chancellor
2026-08-03 14:11 ` Nicolas Schier

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®