From: Juergen Gross Date: Mon, 27 Nov 2023 10:25:23 +0000 (+0100) Subject: Mini-OS: hide all symbols not exported via EXPORT_SYMBOLS() X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=refs%2Fheads%2Fmaster;p=people%2Fandrewcoop%2Fmini-os.git Mini-OS: hide all symbols not exported via EXPORT_SYMBOLS() When doing the final linking of the Mini-OS kernel only keep the symbols visible which have been marked via EXPORT_SYMBOL(). Signed-off-by: Juergen Gross Reviewed-by: Samuel Thibault --- diff --git a/Makefile b/Makefile index 588496c..456aed0 100644 --- a/Makefile +++ b/Makefile @@ -167,6 +167,7 @@ $(OBJ_DIR)/arch/x86/minios-x86%.lds: arch/x86/minios-x86.lds.S $(OBJ_DIR)/$(TARGET)-kern.o: $(OBJS) arch_lib $(OBJ_DIR)/$(TARGET_ARCH_DIR)/minios-$(MINIOS_TARGET_ARCH).lds $(LD) -r $(LDFLAGS) $(HEAD_OBJ) $(OBJS) $(LDARCHLIB) -o $@ $(OBJCOPY) --dump-section .export_symbol=$(OBJ_DIR)/syms $@ + $(OBJCOPY) -w -G $(GLOBAL_PREFIX)* --keep-global-symbols=$(OBJ_DIR)/syms --remove-section=.export_symbol $@ $@ $(OBJ_DIR)/$(TARGET): $(OBJ_DIR)/$(TARGET)-kern.o $(APP_O) $(LD) -r $(LDFLAGS) $(OBJ_DIR)/$(TARGET)-kern.o $(APP_O) $(LDLIBS) -o $@.o