summaryrefslogtreecommitdiff
path: root/nuttx/tools
diff options
context:
space:
mode:
authorGregory Nutt <gnutt@nuttx.org>2014-10-17 06:58:47 -0600
committerGregory Nutt <gnutt@nuttx.org>2014-10-17 06:58:47 -0600
commit4a363d25155e19c315446fb8767e192a80c8d6cd (patch)
tree76f81899f94169f50cf361cfba69f8572ef8ded3 /nuttx/tools
parentaa726319fbff1a762e4d2fbd1c7656ff98351cef (diff)
downloadpx4-nuttx-4a363d25155e19c315446fb8767e192a80c8d6cd.tar.gz
px4-nuttx-4a363d25155e19c315446fb8767e192a80c8d6cd.tar.bz2
px4-nuttx-4a363d25155e19c315446fb8767e192a80c8d6cd.zip
Add a PRELINK macro to Config.mk. From Kriegleder
Diffstat (limited to 'nuttx/tools')
-rw-r--r--nuttx/tools/Config.mk33
1 files changed, 33 insertions, 0 deletions
diff --git a/nuttx/tools/Config.mk b/nuttx/tools/Config.mk
index 6ee7d716e..f222cc0e0 100644
--- a/nuttx/tools/Config.mk
+++ b/nuttx/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)