]> www.infradead.org Git - users/dwmw2/linux.git/commitdiff
x86/boot: Move .head.text into its own output section
authorArd Biesheuvel <ardb@kernel.org>
Thu, 5 Dec 2024 11:28:11 +0000 (12:28 +0100)
committerIngo Molnar <mingo@kernel.org>
Thu, 5 Dec 2024 12:18:55 +0000 (13:18 +0100)
In order to be able to double check that vmlinux is emitted without
absolute symbol references in .head.text, it needs to be distinguishable
from the rest of .text in the ELF metadata.

So move .head.text into its own ELF section.

Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: "H. Peter Anvin" <hpa@zytor.com>
Link: https://lore.kernel.org/r/20241205112804.3416920-15-ardb+git@google.com
arch/x86/kernel/vmlinux.lds.S

index 1ce7889cd12b5aa9dfd1baee7ac11e2a372b5409..56cdf13611e3d4c05ef5829058de1e0b7804a7ad 100644 (file)
@@ -135,8 +135,6 @@ SECTIONS
 #endif
                ALIGN_ENTRY_TEXT_END
 
-               /* bootstrapping code */
-               HEAD_TEXT
                TEXT_TEXT
                SCHED_TEXT
                LOCK_TEXT
@@ -151,6 +149,11 @@ SECTIONS
 
        } :text = 0xcccccccc
 
+       /* bootstrapping code */
+       .head.text : AT(ADDR(.head.text) - LOAD_OFFSET) {
+               HEAD_TEXT
+       } :text = 0xcccccccc
+
        /* End of text section, which should occupy whole number of pages */
        _etext = .;
        . = ALIGN(PAGE_SIZE);