1 Commits

Author SHA1 Message Date
Simon Glass
f379b6570f ulib: scripts: Add a script to support symbol-renaming
When U-Boot is used as a library with other programs, some U-Boot
function names may conflict with the program, or with standard-library
functions. For example, printf() is defined by U-Boot but is typically
used by the program as well.

The easiest solution is to rename symbols in the object file, so that
they appear with a 'ub_' prefix when linked with the program.

Add a new build_api.py script which can:

- rename symbols based on a rename.syms file
- generate a header file (with the renamed symbols) for use by the
  program

This makes use of the 'objcopy --redefine-sym' feature.

The tool has 100% test coverage.

Co-developed-by: Claude <noreply@anthropic.com>
Signed-off-by: Simon Glass <sjg@chromium.org>
2025-09-08 13:09:56 -06:00