From d69c94501932d2731b563f4bf36b48b5a90480fc Mon Sep 17 00:00:00 2001 From: Achilleas Anagnostopoulos Date: Sat, 1 Apr 2017 07:09:49 +0100 Subject: [PATCH] Ensure the we pass the correct symbol address to objcopy If kernel.Kmain defines a nested function then a symbol like `github.com/achilleasa/gopher-os/kernel.Kmain.func1` will be generated. To make sure we always pick the `github.com/achilleasa/gopher-os/kernel.Kmain` symbol address we just need to add a `$` to the grep argument. --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 8fd2d6d..8622097 100644 --- a/Makefile +++ b/Makefile @@ -52,7 +52,7 @@ go.o: @# with slashes we create a global symbol alias for kernel.Kmain @echo "[objcopy] creating global symbol alias 'kernel.Kmain' for 'github.com/achilleasa/gopher-os/kernel.Kmain' in go.o" @objcopy \ - --add-symbol kernel.Kmain=.text:0x`nm $(BUILD_DIR)/go.o | grep "kernel.Kmain" | cut -d' ' -f1` \ + --add-symbol kernel.Kmain=.text:0x`nm $(BUILD_DIR)/go.o | grep "kernel.Kmain$$" | cut -d' ' -f1` \ $(BUILD_DIR)/go.o $(BUILD_DIR)/go.o binutils_version_check: