error compiling Multiboot 2 bootloader: expected relocatable
Posted: Tue Jul 26, 2022 8:02 am
I am writing a bootloader with Multiboot2. I referenced the example code from the specification.
When I am trying to compile it with clang, a error happened on the last line: "error: expected relocatable expression"
Is there any way to solve it?
Thanks.
Code: Select all
multiboot_header: // Multiboot Header
.long MULTIBOOT2_HEADER_MAGIC
.long MULTIBOOT_ARCHITECTURE_I386
.long multiboot_header_end - multiboot_header
.long -(MULTIBOOT2_HEADER_MAGIC + MULTIBOOT_ARCHITECTURE_I386 + (multiboot_header_end - multiboot_header))
Is there any way to solve it?
Thanks.