From cf29dfa2ac05192501cd4f29576ca8e85e105dea Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Fri, 17 Oct 2014 06:58:47 -0600 Subject: [PATCH] Add a PRELINK macro to Config.mk. From Kriegleder --- tools/Config.mk | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) diff --git a/tools/Config.mk b/tools/Config.mk index 6ee7d716ea..f222cc0e0e 100644 --- a/tools/Config.mk +++ b/tools/Config.mk @@ -191,6 +191,39 @@ define ARCHIVE endef endif +# PRELINK - Prelink a list of files +# This is useful when files were compiled with fvisibility=hidden. +# Any symbol which was not explicitly made global is invisible outside the +# prelinked file. +# +# Example: $(call PRELINK, prelink-file, "file1 file2 file3 ...") +# +# Note: The fileN strings may not contain spaces or characters that may be +# interpreted strangely by the shell +# +# Depends on these settings defined in board-specific Make.defs file +# installed at $(TOPDIR)/Make.defs: +# +# LD - The command to invoke the linker (includes any options) +# OBJCOPY - The command to invoke the object cop (includes any options) +# +# Depends on this settings defined in board-specific defconfig file installed +# at $(TOPDIR)/.config: +# +# CONFIG_WINDOWS_NATIVE - Defined for a Windows native build + +ifeq ($(CONFIG_WINDOWS_NATIVE),y) +define PRELINK + @echo PRELINK: $1 + $(Q) $(LD) -Ur -o $1 $2 && $(OBJCOPY) --localize-hidden $1 +endef +else +define PRELINK + @echo "PRELINK: $1" + $(Q) $(LD) -Ur -o $1 $2 && $(OBJCOPY) --localize-hidden $1 +endef +endif + # DELFILE - Delete one file ifeq ($(CONFIG_WINDOWS_NATIVE),y)