public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [U-Boot] [PATCH] examples/standalone: Remove relocation compile flags for PowerPC
@ 2010-06-15  3:25 Peter Tyser
  2010-06-15 19:02 ` Timur Tabi
  2010-06-15 19:48 ` Wolfgang Denk
  0 siblings, 2 replies; 30+ messages in thread
From: Peter Tyser @ 2010-06-15  3:25 UTC (permalink / raw)
  To: u-boot

Previously, standalone applications were compiled with gcc flags that
produced relocatable executables on the PowerPC architecture (eg with
the -mrelocatable and -fPIC flags).  There's no reason for these
applications to be fully relocatable at this time since no relocation
fixups are performed on standalone applications.

Additionally, removing the gcc relocation flags results in the entry
point of applications residing at the base of the image.  When
a standalone application was relocatable, the entry point was generally
located at an offset into the image which was confusing and prone to
errors.

This change moves the entry point of PowerPC standalone applications
from 0x40004 (usually) to 0x40000.

Signed-off-by: Peter Tyser <ptyser@xes-inc.com>
---
I tested this on an 8548-based board and it worked as described above.  It
wouldn't hurt if a few others tried it out to validate that the new entry
point is always 0x40000.

 examples/standalone/Makefile |    8 ++++++++
 1 files changed, 8 insertions(+), 0 deletions(-)

diff --git a/examples/standalone/Makefile b/examples/standalone/Makefile
index 6ea3b93..0c8dbe7 100644
--- a/examples/standalone/Makefile
+++ b/examples/standalone/Makefile
@@ -72,6 +72,14 @@ gcclibdir := $(shell dirname `$(CC) -print-libgcc-file-name`)
 
 CPPFLAGS += -I..
 
+# For PowerPC there's no need to compile standalone applications as a
+# relocatable executable.  The relocation data is not needed, and
+# also causes the entry point of the standalone application to be
+# inconsistent.
+ifeq ($(ARCH),powerpc)
+CFLAGS := $(filter-out $(RELFLAGS),$(CFLAGS))
+endif
+
 all:	$(obj).depend $(OBJS) $(LIB) $(SREC) $(BIN) $(ELF)
 
 #########################################################################
-- 
1.7.0.4

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

end of thread, other threads:[~2010-10-12 20:47 UTC | newest]

Thread overview: 30+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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
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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox