path: root/com32/elflink/ldlinux/Makefile
diff options
authorMatt Fleming <matt.fleming@intel.com>2012-12-04 21:17:47 +0000
committerMatt Fleming <matt.fleming@intel.com>2012-12-05 22:41:32 +0000
commite4b3ce2dd82ce2da85c37fd3f332ec2eb802b734 (patch)
tree8b98440a37716dab0bd4de8b87a3800e5a40b07b /com32/elflink/ldlinux/Makefile
parenta79ceb45909434d392aacbb92eb2dfa738479783 (diff)
Symbol export whitelist
Before modules were dynamically loaded the boundary between GPL and non-GPL code was implicit because of the separate link domains for each module. With dynamic modules we need an explicit whitelist of core symbols that non-GPL code can link against at runtime without needing to be re-licensed under the GPL. Mark such symbols with __export, so that it is explicitly clear which symbols in the core can be linked against by non-GPL code. Reduce the visibility of symbols in both the core and ldlinux.c32 with -fvisibility=hidden. __export changes the visibility to 'default'. Signed-off-by: Matt Fleming <matt.fleming@intel.com>
Diffstat (limited to 'com32/elflink/ldlinux/Makefile')
1 files changed, 2 insertions, 1 deletions
diff --git a/com32/elflink/ldlinux/Makefile b/com32/elflink/ldlinux/Makefile
index b4e5cfa1..93ca127d 100644
--- a/com32/elflink/ldlinux/Makefile
+++ b/com32/elflink/ldlinux/Makefile
@@ -14,7 +14,7 @@ topdir = ../../..
MAKEDIR = $(topdir)/mk
include $(MAKEDIR)/elf.mk
-CFLAGS += -I$(topdir)/core/elflink -I$(topdir)/core/include -I$(topdir)/com32/lib
+CFLAGS += -I$(topdir)/core/elflink -I$(topdir)/core/include -I$(topdir)/com32/lib -fvisibility=hidden
LIBS = --whole-archive $(com32)/lib/libcom32min.a
all: ldlinux.c32 ldlinux_lnx.a
@@ -24,6 +24,7 @@ ldlinux.c32 : ldlinux.o cli.o readconfig.o refstr.o colors.o getadv.o \
advwrite.o setadv.o eprintf.o loadhigh.o msg.o
$(LD) $(LDFLAGS) -o $@ $^ $(LIBS)
+LNXCFLAGS += -D__export='__attribute__((visibility("default")))'
LNXLIBOBJS = get_key.lo
ldlinux_lnx.a: $(LNXLIBOBJS)
rm -f $@