From: Peter Tyser <ptyser@xes-inc.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH] examples/standalone: Remove relocation compile flags for PowerPC
Date: Tue, 15 Jun 2010 15:15:05 -0500 [thread overview]
Message-ID: <1276632905.32134.1535.camel@petert> (raw)
In-Reply-To: <4C17D851.4010307@freescale.com>
On Tue, 2010-06-15 at 14:45 -0500, Timur Tabi wrote:
> Peter Tyser wrote:
> > Was commenting out the 'ifeq' above necessary? It shouldn't be, so my
> > first question would be why it was needed.
>
> Probably because I was using an older U-Boot. When I switch to the latest
> code, it compiles fine.
>
> However, my entry point is not at 40000:
>
> $ nm -n examples/standalone/flash_wp
> 00040000 t command_exit
> 000400c4 t is_locked
> 00040184 T flash_wp
> 000403d0 T dummy
>
> 'flash_wp' should be at 40000. command_exit and is_locked are two functions
> in my code. command_exit, however, is not the first function, it's the third.
I think by default its not possible to guarantee function order in gcc's
output if a file contains multiple functions. We could create a basic
linker script... I think we could also do it with some gcc/ld-foo like:
--- a/examples/standalone/Makefile
+++ b/examples/standalone/Makefile
@@ -78,6 +78,7 @@ CPPFLAGS += -I..
# inconsistent.
ifeq ($(ARCH),powerpc)
CFLAGS := $(filter-out $(RELFLAGS),$(CFLAGS))
+CFLAGS += -fno-toplevel-reorder
endif
all: $(obj).depend $(OBJS) $(LIB) $(SREC) $(BIN) $(ELF)
@@ -88,7 +89,7 @@ $(LIB): $(obj).depend $(LIBOBJS)
$(ELF):
$(obj)%: $(obj)%.o $(LIB)
- $(LD) -g -Ttext $(STANDALONE_LOAD_ADDR) \
+ $(LD) -g -Ttext $(STANDALONE_LOAD_ADDR) -sort-common \
-o $@ -e $(SYM_PREFIX)$(notdir $(<:.o=)) $< $(LIB) \
-L$(gcclibdir) -lgcc
Could you try the above change with your flash_wp test case? Or make
the flash_wp app public? It should put the first function@the base
of the image in theory.
Best,
Peter
next prev parent reply other threads:[~2010-06-15 20:15 UTC|newest]
Thread overview: 30+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-06-15 3:25 [U-Boot] [PATCH] examples/standalone: Remove relocation compile flags for PowerPC Peter Tyser
2010-06-15 19:02 ` Timur Tabi
2010-06-15 19:05 ` Timur Tabi
2010-06-15 19:08 ` Peter Tyser
2010-06-15 19:20 ` Timur Tabi
2010-06-15 19:34 ` Peter Tyser
2010-06-15 19:36 ` Peter Tyser
2010-06-15 19:45 ` Timur Tabi
2010-06-15 20:15 ` Peter Tyser [this message]
2010-06-15 20:28 ` Wolfgang Denk
2010-06-15 20:39 ` Peter Tyser
2010-06-15 20:51 ` Wolfgang Denk
2010-06-16 3:37 ` Peter Tyser
2010-06-16 14:02 ` Timur Tabi
2010-06-16 14:51 ` Wolfgang Denk
2010-09-10 19:49 ` Wolfgang Denk
2010-09-10 19:53 ` Timur Tabi
2010-09-10 20:07 ` Peter Tyser
2010-09-10 21:10 ` Wolfgang Denk
2010-09-12 22:38 ` [U-Boot] [PATCH] examples/standalone: Use gcc's -fno-toplevel-reorder Peter Tyser
2010-09-13 2:00 ` Andrew Dyer
2010-09-13 4:48 ` Peter Tyser
2010-09-16 11:49 ` Detlev Zundel
2010-10-12 20:47 ` Wolfgang Denk
2010-06-15 20:39 ` [U-Boot] [PATCH] examples/standalone: Remove relocation compile flags for PowerPC Timur Tabi
2010-06-15 20:54 ` Wolfgang Denk
2010-06-15 21:03 ` Timur Tabi
2010-06-15 22:56 ` Wolfgang Denk
2010-06-15 19:48 ` Wolfgang Denk
2010-06-29 20:29 ` Wolfgang Denk
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1276632905.32134.1535.camel@petert \
--to=ptyser@xes-inc.com \
--cc=u-boot@lists.denx.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox