]> xenbits.xensource.com Git - people/aperard/mini-os.git/commitdiff
Mini-OS: don't use objcopy --dump-section
authorJuergen Gross <jgross@suse.com>
Wed, 6 Dec 2023 16:17:44 +0000 (17:17 +0100)
committerAndrew Cooper <andrew.cooper3@citrix.com>
Thu, 7 Dec 2023 18:53:04 +0000 (18:53 +0000)
The objcopy option "--dump-section" isn't supported in binutils before
version 2.25, which are still supported by the Xen build system.

Avoid that by using the "-O binary" format together with
"--only-section". This requires to set the "alloc" section flag.

Fixes: 33411a11f848 ("Mini-OS: hide all symbols not exported via EXPORT_SYMBOLS()")
Signed-off-by: Juergen Gross <jgross@suse.com>
Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
Makefile

index 456aed0bf169d8a801cfd69a60b19945dd91c8b3..6c8df8b5847790e23f4fb4567a4316be0c3ba1c4 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -166,7 +166,9 @@ $(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 $@
+       # The following would be neat, but isn't supported in binutils < 2.25
+       # $(OBJCOPY) --dump-section .export_symbol=$(OBJ_DIR)/syms $@
+       $(OBJCOPY) --set-section-flags .export_symbol=alloc -O binary --only-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)