mirror of
https://github.com/AsahiLinux/u-boot
synced 2024-12-25 12:33:41 +00:00
7c15013639
A recent change adjusted the symbol calculation to work on x86 but broke
it for Tegra. In fact this is because they have different needs.
On x86 devices the code is linked to a ROM address and the end-at-4gb
property is used for the image. In this case there is no need to add the
base address of the image, since the base address is already built into
the offset and image-pos properties.
On other devices we must add the base address since the offsets start at
zero.
In addition the base address is currently added to the 'offset' and 'size'
values. It should in fact only be added to 'image-pos', since 'offset' is
relative to its parent and 'size' is not actually an address. This code
should have been adjusted when support for 'image-pos' and 'size' was
added, but it was not.
To correct these problems:
- move the code that handles adding the base address to section.py, which
can check the end-at-4gb property and which property
(offset/size/image-pos) is being read
- add the base address only when needed (only for image-pos and not if the
image uses end-at-4gb)
- add a note to the documentation
- add a separate test to cover x86 behaviour
Fixes: 15c981cc
(binman: Correct symbol calculation with non-zero image base)
Signed-off-by: Simon Glass <sjg@chromium.org>
Tested-by: Stephen Warren <swarren@nvidia.com>
61 lines
1.7 KiB
Makefile
61 lines
1.7 KiB
Makefile
#
|
|
# Builds test programs. This is launched from elf_test.BuildElfTestFiles()
|
|
#
|
|
# Copyright (C) 2017 Google, Inc
|
|
# Written by Simon Glass <sjg@chromium.org>
|
|
#
|
|
# SPDX-License-Identifier: GPL-2.0+
|
|
#
|
|
|
|
VPATH := $(SRC)
|
|
CFLAGS := -march=i386 -m32 -nostdlib -I $(SRC)../../../include \
|
|
-Wl,--no-dynamic-linker
|
|
|
|
LDS_UCODE := -T $(SRC)u_boot_ucode_ptr.lds
|
|
LDS_BINMAN := -T $(SRC)u_boot_binman_syms.lds
|
|
LDS_BINMAN_BAD := -T $(SRC)u_boot_binman_syms_bad.lds
|
|
LDS_BINMAN_X86 := -T $(SRC)u_boot_binman_syms_x86.lds
|
|
|
|
TARGETS = u_boot_ucode_ptr u_boot_no_ucode_ptr bss_data \
|
|
u_boot_binman_syms u_boot_binman_syms.bin u_boot_binman_syms_bad \
|
|
u_boot_binman_syms_size u_boot_binman_syms_x86
|
|
|
|
all: $(TARGETS)
|
|
|
|
u_boot_no_ucode_ptr: CFLAGS += $(LDS_UCODE)
|
|
u_boot_no_ucode_ptr: u_boot_no_ucode_ptr.c
|
|
|
|
u_boot_ucode_ptr: CFLAGS += $(LDS_UCODE)
|
|
u_boot_ucode_ptr: u_boot_ucode_ptr.c
|
|
|
|
bss_data: CFLAGS += $(SRC)bss_data.lds
|
|
bss_data: bss_data.c
|
|
|
|
u_boot_binman_syms.bin: u_boot_binman_syms
|
|
objcopy -O binary $< -R .note.gnu.build-id $@
|
|
|
|
u_boot_binman_syms: CFLAGS += $(LDS_BINMAN)
|
|
u_boot_binman_syms: u_boot_binman_syms.c
|
|
|
|
u_boot_binman_syms_x86: CFLAGS += $(LDS_BINMAN_X86)
|
|
u_boot_binman_syms_x86: u_boot_binman_syms_x86.c
|
|
|
|
u_boot_binman_syms_bad: CFLAGS += $(LDS_BINMAN_BAD)
|
|
u_boot_binman_syms_bad: u_boot_binman_syms_bad.c
|
|
|
|
u_boot_binman_syms_size: CFLAGS += $(LDS_BINMAN)
|
|
u_boot_binman_syms_size: u_boot_binman_syms_size.c
|
|
|
|
clean:
|
|
rm -f $(TARGETS)
|
|
|
|
help:
|
|
@echo "Makefile for binman test programs"
|
|
@echo
|
|
@echo "Intended for use on x86 hosts"
|
|
@echo
|
|
@echo "Targets:"
|
|
@echo
|
|
@echo -e "\thelp - Print help (this is it!)"
|
|
@echo -e "\tall - Builds test programs (default targget)"
|
|
@echo -e "\tclean - Delete output files"
|