All of lore.kernel.org
 help / color / mirror / Atom feed
* [U-Boot] [PATCH v3 001/108] binman: Correct symbol calculation with non-zero image base
@ 2019-10-21  3:31 Simon Glass
  2019-10-21  3:31 ` [U-Boot] [PATCH v3 002/108] binman: Add support for Intel FSP-S Simon Glass
                   ` (20 more replies)
  0 siblings, 21 replies; 61+ messages in thread
From: Simon Glass @ 2019-10-21  3:31 UTC (permalink / raw)
  To: u-boot

At present binman adds the image base address to the symbol value before
it writes it to the binary. This is not correct since the symbol value
itself (e.g. image position) has no relationship to the image base.

Fix this and update the tests to cover this case.

Signed-off-by: Simon Glass <sjg@chromium.org>
---

Changes in v3: None
Changes in v2: None

 tools/binman/elf.py                      | 4 +---
 tools/binman/test/u_boot_binman_syms.lds | 2 +-
 2 files changed, 2 insertions(+), 4 deletions(-)

diff --git a/tools/binman/elf.py b/tools/binman/elf.py
index 7bc7cf61b5d..0c1a5b44b66 100644
--- a/tools/binman/elf.py
+++ b/tools/binman/elf.py
@@ -135,9 +135,7 @@ def LookupAndWriteSymbols(elf_fname, entry, section):
 
             # Look up the symbol in our entry tables.
             value = section.LookupSymbol(name, sym.weak, msg)
-            if value is not None:
-                value += base.address
-            else:
+            if value is None:
                 value = -1
                 pack_string = pack_string.lower()
             value_bytes = struct.pack(pack_string, value)
diff --git a/tools/binman/test/u_boot_binman_syms.lds b/tools/binman/test/u_boot_binman_syms.lds
index 926df873cb7..825fc3f649f 100644
--- a/tools/binman/test/u_boot_binman_syms.lds
+++ b/tools/binman/test/u_boot_binman_syms.lds
@@ -9,7 +9,7 @@ ENTRY(_start)
 
 SECTIONS
 {
-	. = 0x00000000;
+	. = 0x00000010;
 	_start = .;
 
 	. = ALIGN(4);
-- 
2.23.0.866.gb869b98d4c-goog

^ permalink raw reply related	[flat|nested] 61+ messages in thread

end of thread, other threads:[~2019-11-04  8:28 UTC | newest]

Thread overview: 61+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-10-21  3:31 [U-Boot] [PATCH v3 001/108] binman: Correct symbol calculation with non-zero image base Simon Glass
2019-10-21  3:31 ` [U-Boot] [PATCH v3 002/108] binman: Add support for Intel FSP-S Simon Glass
2019-10-28  3:27   ` Bin Meng
2019-11-02  9:38     ` Bin Meng
2019-10-21  3:31 ` [U-Boot] [PATCH v3 003/108] binman: Add support for Intel FSP-T Simon Glass
2019-10-28  3:27   ` Bin Meng
2019-11-02  9:38     ` Bin Meng
2019-10-21  3:31 ` [U-Boot] [PATCH v3 004/108] binman: Fix up comment in intel-fsp-m Simon Glass
2019-10-28  3:27   ` Bin Meng
2019-11-02  9:38     ` Bin Meng
2019-10-21  3:31 ` [U-Boot] [PATCH v3 005/108] binman: Add a library to access binman entries Simon Glass
2019-10-28  3:27   ` Bin Meng
2019-10-21  3:31 ` [U-Boot] [PATCH v3 006/108] dm: gpio: Allow control of GPIO uclass in SPL Simon Glass
2019-10-28  4:45   ` Bin Meng
2019-11-02  9:38     ` Bin Meng
2019-11-02 23:10       ` Bin Meng
2019-10-21  3:31 ` [U-Boot] [PATCH v3 007/108] dm: core: Fix offset_to_ofnode() with invalid offset Simon Glass
2019-10-28  4:45   ` Bin Meng
2019-10-21  3:31 ` [U-Boot] [PATCH v3 008/108] dm: pci: Delay auto-config until after relocation Simon Glass
2019-10-28  4:45   ` Bin Meng
2019-10-21  3:31 ` [U-Boot] [PATCH v3 009/108] dm: pci: Move pci_get_devfn() into a common file Simon Glass
2019-10-28  4:45   ` Bin Meng
2019-10-21  3:31 ` [U-Boot] [PATCH v3 010/108] net: Move the checksum functions to lib/ Simon Glass
2019-10-28  4:45   ` Bin Meng
2019-10-21  3:31 ` [U-Boot] [PATCH v3 011/108] i2c: Tidy up designware PCI support Simon Glass
2019-10-28  4:40   ` Heiko Schocher
2019-10-28  5:54   ` Bin Meng
2019-10-28 10:43   ` Stefan Roese
2019-10-21  3:31 ` [U-Boot] [PATCH v3 012/108] spl: Correct priority selection for image loaders Simon Glass
2019-10-28  5:54   ` Bin Meng
2019-11-02  9:42     ` Bin Meng
2019-10-21  3:31 ` [U-Boot] [PATCH v3 013/108] x86: spi: Add helper functions for Intel Fast SPI Simon Glass
2019-11-02  4:13   ` Bin Meng
2019-11-02 21:04     ` Simon Glass
2019-11-02 23:18       ` Bin Meng
2019-11-03 14:36         ` Simon Glass
2019-11-03 23:40           ` Simon Glass
2019-10-21  3:31 ` [U-Boot] [PATCH v3 014/108] spi: Add support for memory-mapped flash Simon Glass
2019-11-02  4:13   ` Bin Meng
2019-11-02  9:42     ` Bin Meng
2019-10-21  3:31 ` [U-Boot] [PATCH v3 015/108] dm: doc: Correct of-platdata driver name Simon Glass
2019-10-28  5:59   ` Bin Meng
2019-11-02  9:42     ` Bin Meng
2019-10-21  3:31 ` [U-Boot] [PATCH v3 016/108] fdt: Show the preprocessed .dts file on error Simon Glass
2019-10-28  6:47   ` Bin Meng
2019-11-02 18:02     ` Simon Glass
2019-11-04  8:28       ` Bin Meng
2019-10-21  3:31 ` [U-Boot] [PATCH v3 017/108] RFC: sandbox: net: Suppress the MAC-address warnings Simon Glass
2019-10-21  3:31 ` [U-Boot] [PATCH v3 018/108] Revert "RFC: sandbox: net: Suppress the MAC-address warnings" Simon Glass
2019-10-28  6:16   ` Bin Meng
2019-11-02 18:07     ` Simon Glass
2019-10-21  3:31 ` [U-Boot] [PATCH v3 019/108] spl: Add a size check for TPL Simon Glass
2019-10-28  6:34   ` Bin Meng
2019-11-02  9:47     ` Bin Meng
2019-10-21  3:31 ` [U-Boot] [PATCH v3 020/108] sandbox: pci: Create a new sandbox_pci_read_bar() function Simon Glass
2019-10-28  6:36   ` Bin Meng
2019-10-21  3:31 ` [U-Boot] [PATCH v3 021/108] x86: timer: Set up the timer in timer_early_get_count() Simon Glass
2019-10-28  7:12   ` Bin Meng
2019-11-02  9:47     ` Bin Meng
2019-10-28  3:27 ` [U-Boot] [PATCH v3 001/108] binman: Correct symbol calculation with non-zero image base Bin Meng
2019-11-02  9:38   ` Bin Meng

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.