common/elf.c contains code that's only relevant to barebox proper, code
that is only used by the PBL and code that is used for both.

This works when we compile with linker garbage collection, but we don't
do this on sandbox. Sandbox is a PBL-only platform nowadays, so this
leads to linker errors as without LTO, the linker can't determine that
e.g. the reference to list_sort is ultimately unused in PBL.

Instead of stubbing out the functions needed, let's reorganize it, so
most of the original support remains in common/elf.c and the noalloc
and relocation parts move to lib/elf.c

Ahmad Fatoum (3):
  elf: rename elf.h to <linux/elf.h>
  common: elf: split barebox proper-only ELF support from the rest
  common: elf: reorganize barebox proper parts in struct elf_image

 common/Makefile     |   2 +-
 common/elf.c        | 351 +-----------------------------
 include/elf.h       | 511 +-------------------------------------------
 include/lib/elf.h   |  76 +++++++
 include/linux/elf.h | 472 ++++++++++++++++++++++++++++++++++++++++
 lib/Makefile        |   1 +
 lib/elf.c           | 329 ++++++++++++++++++++++++++++
 7 files changed, 891 insertions(+), 851 deletions(-)
 create mode 100644 include/lib/elf.h
 create mode 100644 include/linux/elf.h
 create mode 100644 lib/elf.c

-- 
2.47.3


Reply via email to