[RFC PATCH 0/2] Add a linker-list consistency checker

Simon Glass sjg at chromium.org
Tue May 26 00:26:30 CEST 2026


Linker lists rely on contiguous symbols laid out at consistent
alignment. When the linker inserts padding the start/end pointer
arithmetic silently produces garbage, leading to baffling runtime
failures such as wildly negative test counts.

Add a small Python script that walks the linked u-boot image with
nm -S, flags gaps that look like padding, and verifies that each
list span is a whole multiple of its element size. Wire it into
the Makefile so it runs after the final link.


Simon Glass (2):
  scripts: Add a script check consistency of linker lists
  check_linker_lists: Enhance detection of alignment problems

 Makefile                      |   5 +
 scripts/check_linker_lists.py | 292 ++++++++++++++++++++++++++++++++++
 2 files changed, 297 insertions(+)
 create mode 100755 scripts/check_linker_lists.py

---
base-commit: 7bb1917b15b77a7d8c27045df33b6bbc214c2f67
branch: linker-list

-- 
2.43.0



More information about the U-Boot mailing list