Skip to content

Instantly share code, notes, and snippets.

@fcicq
Created October 23, 2018 05:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save fcicq/e32dd41b0b5c197237ca084584e6b871 to your computer and use it in GitHub Desktop.
Save fcicq/e32dd41b0b5c197237ca084584e6b871 to your computer and use it in GitHub Desktop.
fix ld.lld: error: ./arch/x86/kernel/vmlinux.lds:342: at least one side of the expression must be absolute
diff --git a/arch/x86/kernel/vmlinux.lds.S b/arch/x86/kernel/vmlinux.lds.S
index f05f00acac89..7fe2ee55c713 100644
--- a/arch/x86/kernel/vmlinux.lds.S
+++ b/arch/x86/kernel/vmlinux.lds.S
@@ -364,7 +364,7 @@ SECTIONS
* Per-cpu symbols which need to be offset from __per_cpu_load
* for the boot processor.
*/
-#define INIT_PER_CPU(x) init_per_cpu__##x = x + __per_cpu_load
+#define INIT_PER_CPU(x) init_per_cpu__##x = ABSOLUTE(x) + __per_cpu_load
INIT_PER_CPU(gdt_page);
INIT_PER_CPU(irq_stack_union);
@fcicq
Copy link
Author

fcicq commented Oct 23, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment