From: Peter Tyser Date: Sun, 12 Sep 2010 22:38:49 +0000 (-0500) Subject: examples/standalone: Use gcc's -fno-toplevel-reorder X-Git-Url: http://git.lede-project.org./?a=commitdiff_plain;h=c91d456c055237bdadb99a80e198748b8cf32595;p=project%2Fbcm63xx%2Fu-boot.git examples/standalone: Use gcc's -fno-toplevel-reorder Using -fno-toplevel-reorder causes gcc to not reorder functions. This ensures that an application's entry point will be the first function in the application's source file. This change, along with commit 620bbba524fbaa26971a5004793010b169824f1b should cause a standalone application's entry point to be at the base of the compiled binary. Previously, the entry point could change depending on gcc version and flags. Note -fno-toplevel-reorder is only available in gcc version 4.2 or greater. Signed-off-by: Peter Tyser --- diff --git a/examples/standalone/Makefile b/examples/standalone/Makefile index 5f1f800807..c2dd514d93 100644 --- a/examples/standalone/Makefile +++ b/examples/standalone/Makefile @@ -82,6 +82,11 @@ CFLAGS := $(filter-out $(RELFLAGS),$(CFLAGS)) CPPFLAGS := $(filter-out $(RELFLAGS),$(CPPFLAGS)) endif +# We don't want gcc reordering functions if possible. This ensures that an +# application's entry point will be the first function in the application's +# source file. +CFLAGS += $(call cc-option,-fno-toplevel-reorder) + all: $(obj).depend $(OBJS) $(LIB) $(SREC) $(BIN) $(ELF) #########################################################################