aboutsummaryrefslogtreecommitdiff
path: root/plugins/Makefile.objs
diff options
context:
space:
mode:
authorEmilio G. Cota <cota@braap.org>2018-10-21 13:56:29 -0400
committerAlex Bennée <alex.bennee@linaro.org>2019-10-28 15:12:38 +0000
commit26fffe29c09656273fd9553339552f8d41330949 (patch)
tree00bdf5d7fa0ce43d3d710eb33d1f128571c7442c /plugins/Makefile.objs
parent40e8c6f48afc35998f15960e0299ecb7f8a9f3e5 (diff)
plugin: add API symbols to qemu-plugins.symbols
Signed-off-by: Emilio G. Cota <cota@braap.org> [AJB: moved into plugins] Signed-off-by: Alex Bennée <alex.bennee@linaro.org> Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Diffstat (limited to 'plugins/Makefile.objs')
-rw-r--r--plugins/Makefile.objs14
1 files changed, 14 insertions, 0 deletions
diff --git a/plugins/Makefile.objs b/plugins/Makefile.objs
index 95baabf3d2..6f14d91ccb 100644
--- a/plugins/Makefile.objs
+++ b/plugins/Makefile.objs
@@ -5,3 +5,17 @@
obj-y += loader.o
obj-y += core.o
obj-y += api.o
+
+# Abuse -libs suffix to only link with --dynamic-list/-exported_symbols_list
+# when the final binary includes the plugin object.
+#
+# Note that simply setting LDFLAGS is not enough: we build binaries that
+# never link plugin.o, and the linker might fail (at least ld64 does)
+# if the symbols in the list are not in the output binary.
+ifdef CONFIG_HAS_LD_DYNAMIC_LIST
+api.o-libs := -Wl,--dynamic-list=$(BUILD_DIR)/qemu-plugins-ld.symbols
+else
+ifdef CONFIG_HAS_LD_EXPORTED_SYMBOLS_LIST
+api.o-libs := -Wl,-exported_symbols_list,$(BUILD_DIR)/qemu-plugins-ld64.symbols
+endif
+endif