[U-Boot,v4,2/4] u-boot.elf: allow overriding entry symbol

Submitted by Álvaro Fernández Rojas on April 20, 2017, 6:36 p.m.

Details

Message ID 1492713388-310-3-git-send-email-noltari@gmail.com
State Accepted
Commit 96ee1ada5dce6e193f68a2cd235cb3e8147178ec
Delegated to: Daniel Schwierzeck
Headers show

Commit Message

Álvaro Fernández Rojas April 20, 2017, 6:36 p.m.
LD gives the following warning when trying to process u-boot-elf.o
warning: cannot find entry symbol __start; defaulting to 0000000080010000
According to gnu-libc the entry symbol for mips is __start and not _start:
https://sourceware.org/git/?p=glibc.git;a=blob;f=sysdeps/mips/dl-machine.h;h=ed47513ccc1d23d23d32ee640053d2f351f3990b;hb=HEAD#l258

Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
---
 v4: Introduce changes suggested by Tom Rini:
  - __start is the standard for MIPS, not ARM.
 v3: Introduce changes suggested by Daniel Schwierzeck:
  - Split patches.
 v2: Introduce changes suggested by Daniel Schwierzeck:
  - Fix _start vs __start symbol.

 Makefile | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

Comments

Tom Rini April 20, 2017, 7:57 p.m.
On Thu, Apr 20, 2017 at 08:36:26PM +0200, Álvaro Fernández Rojas wrote:

> LD gives the following warning when trying to process u-boot-elf.o
> warning: cannot find entry symbol __start; defaulting to 0000000080010000
> According to gnu-libc the entry symbol for mips is __start and not _start:
> https://sourceware.org/git/?p=glibc.git;a=blob;f=sysdeps/mips/dl-machine.h;h=ed47513ccc1d23d23d32ee640053d2f351f3990b;hb=HEAD#l258
> 
> Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>

After a little reading of other platforms, _start seems a reasonable
default so:

Reviewed-by: Tom Rini <trini@konsulko.com>

Thanks!
Daniel Schwierzeck April 30, 2017, 6:41 p.m.
Am 20.04.2017 um 20:36 schrieb Álvaro Fernández Rojas:
> LD gives the following warning when trying to process u-boot-elf.o
> warning: cannot find entry symbol __start; defaulting to 0000000080010000
> According to gnu-libc the entry symbol for mips is __start and not _start:
> https://sourceware.org/git/?p=glibc.git;a=blob;f=sysdeps/mips/dl-machine.h;h=ed47513ccc1d23d23d32ee640053d2f351f3990b;hb=HEAD#l258
> 
> Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
> ---
>  v4: Introduce changes suggested by Tom Rini:
>   - __start is the standard for MIPS, not ARM.
>  v3: Introduce changes suggested by Daniel Schwierzeck:
>   - Split patches.
>  v2: Introduce changes suggested by Daniel Schwierzeck:
>   - Fix _start vs __start symbol.
> 
>  Makefile | 5 ++++-
>  1 file changed, 4 insertions(+), 1 deletion(-)
> 

applied to u-boot-mips/next, thanks!

Patch hide | download patch | download mbox

diff --git a/Makefile b/Makefile
index 8730550..6cf2568 100644
--- a/Makefile
+++ b/Makefile
@@ -1184,10 +1184,13 @@  u-boot-img-spl-at-end.bin: u-boot.img spl/u-boot-spl.bin FORCE
 	$(call if_changed,pad_cat)
 
 # Create a new ELF from a raw binary file.
+ifndef PLATFORM_ELFENTRY
+  PLATFORM_ELFENTRY = "_start"
+endif
 u-boot.elf: u-boot.bin
 	@$(OBJCOPY) -I binary $(PLATFORM_ELFFLAGS) $< u-boot-elf.o
 	@$(LD) u-boot-elf.o -o $@ \
-		--defsym=_start=$(CONFIG_SYS_TEXT_BASE) \
+		--defsym=$(PLATFORM_ELFENTRY)=$(CONFIG_SYS_TEXT_BASE) \
 		-Ttext=$(CONFIG_SYS_TEXT_BASE)
 
 # Rule to link u-boot