Skip to content

Commit

Permalink
x86/boot: Move .head.text into its own output section
Browse files Browse the repository at this point in the history
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 <[email protected]>
Signed-off-by: Ingo Molnar <[email protected]>
Cc: Linus Torvalds <[email protected]>
Cc: "H. Peter Anvin" <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
  • Loading branch information
ardbiesheuvel authored and Ingo Molnar committed Dec 5, 2024
1 parent 35350eb commit a6a4ae9
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions arch/x86/kernel/vmlinux.lds.S
Original file line number Diff line number Diff line change
Expand Up @@ -135,8 +135,6 @@ SECTIONS
#endif
ALIGN_ENTRY_TEXT_END

/* bootstrapping code */
HEAD_TEXT
TEXT_TEXT
SCHED_TEXT
LOCK_TEXT
Expand All @@ -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);
Expand Down

0 comments on commit a6a4ae9

Please sign in to comment.