-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
binman: tegra: Adjust symbol calculation depending on end-at-4gb
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: 15c981c (binman: Correct symbol calculation with non-zero image base) Signed-off-by: Simon Glass <[email protected]> Tested-by: Stephen Warren <[email protected]>
- Loading branch information
Showing
10 changed files
with
134 additions
and
26 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
/* SPDX-License-Identifier: GPL-2.0+ */ | ||
/dts-v1/; | ||
|
||
/ { | ||
#address-cells = <1>; | ||
#size-cells = <1>; | ||
|
||
binman { | ||
pad-byte = <0xff>; | ||
end-at-4gb; | ||
size = <0x100>; | ||
u-boot-spl { | ||
offset = <0xffffff04>; | ||
}; | ||
|
||
u-boot-spl2 { | ||
offset = <0xffffff1c>; | ||
type = "u-boot-spl"; | ||
}; | ||
|
||
u-boot { | ||
offset = <0xffffff34>; | ||
}; | ||
|
||
section { | ||
u-boot-tpl { | ||
type = "u-boot-tpl"; | ||
}; | ||
}; | ||
}; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
u_boot_binman_syms.c |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
/* SPDX-License-Identifier: GPL-2.0+ */ | ||
/* | ||
* Copyright (c) 2016 Google, Inc | ||
*/ | ||
|
||
OUTPUT_FORMAT("elf32-i386", "elf32-i386", "elf32-i386") | ||
OUTPUT_ARCH(i386) | ||
ENTRY(_start) | ||
|
||
SECTIONS | ||
{ | ||
. = 0xffffff00; | ||
_start = .; | ||
|
||
. = ALIGN(4); | ||
.text : | ||
{ | ||
__image_copy_start = .; | ||
*(.text*) | ||
} | ||
|
||
. = ALIGN(4); | ||
.binman_sym_table : { | ||
__binman_sym_start = .; | ||
KEEP(*(SORT(.binman_sym*))); | ||
__binman_sym_end = .; | ||
} | ||
.interp : { *(.interp*) } | ||
|
||
} |