[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[mini-os master] Mini-OS: don't use objcopy --dump-section



commit 090eeeb1631f00a9a41ebf66d9b4aacb97eb51e7
Author:     Juergen Gross <jgross@xxxxxxxx>
AuthorDate: Wed Dec 6 17:17:44 2023 +0100
Commit:     Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
CommitDate: Thu Dec 7 18:53:04 2023 +0000

    Mini-OS: don't use objcopy --dump-section
    
    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@xxxxxxxx>
    Reviewed-by: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
---
 Makefile | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/Makefile b/Makefile
index 456aed0..6c8df8b 100644
--- 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)
--
generated by git-patchbot for /home/xen/git/mini-os.git#master



 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.