提交 c91d456c 编写于 作者: P Peter Tyser 提交者: Wolfgang Denk

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 620bbba5
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: NPeter Tyser <ptyser@xes-inc.com>
上级 92d1a400
......@@ -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)
#########################################################################
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册