浏览代码

x86: convert to use __HEAD and HEAD_TEXT macros.

This has the consequence of changing the section name use for head
code from ".text.head" to ".head.text".  It also eliminates the
".text.head" output section (instead placing head code at the start of
the .text output section), which should be harmless.

This patch only changes the sections in the actual kernel, not those
in the compressed boot loader.

Signed-off-by: Tim Abbott <tabbott@ksplice.com>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: Sam Ravnborg <sam@ravnborg.org>
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
Tim Abbott 15 年之前
父节点
当前提交
4ae59b916d
共有 3 个文件被更改,包括 5 次插入11 次删除
  1. 1 1
      arch/x86/kernel/head_32.S
  2. 1 1
      arch/x86/kernel/head_64.S
  3. 3 9
      arch/x86/kernel/vmlinux.lds.S

+ 1 - 1
arch/x86/kernel/head_32.S

@@ -79,7 +79,7 @@ RESERVE_BRK(pagetables, INIT_MAP_SIZE)
  * any particular GDT layout, because we load our own as soon as we
  * any particular GDT layout, because we load our own as soon as we
  * can.
  * can.
  */
  */
-.section .text.head,"ax",@progbits
+__HEAD
 ENTRY(startup_32)
 ENTRY(startup_32)
 	/* test KEEP_SEGMENTS flag to see if the bootloader is asking
 	/* test KEEP_SEGMENTS flag to see if the bootloader is asking
 		us to not reload segments */
 		us to not reload segments */

+ 1 - 1
arch/x86/kernel/head_64.S

@@ -40,7 +40,7 @@ L4_START_KERNEL = pgd_index(__START_KERNEL_map)
 L3_START_KERNEL = pud_index(__START_KERNEL_map)
 L3_START_KERNEL = pud_index(__START_KERNEL_map)
 
 
 	.text
 	.text
-	.section .text.head
+	__HEAD
 	.code64
 	.code64
 	.globl startup_64
 	.globl startup_64
 startup_64:
 startup_64:

+ 3 - 9
arch/x86/kernel/vmlinux.lds.S

@@ -65,17 +65,11 @@ SECTIONS
 #endif
 #endif
 
 
 	/* Text and read-only data */
 	/* Text and read-only data */
-
-	/* bootstrapping code */
-	.text.head : AT(ADDR(.text.head) - LOAD_OFFSET) {
-		_text = .;
-		*(.text.head)
-	} :text = 0x9090
-
-	/* The rest of the text */
 	.text :  AT(ADDR(.text) - LOAD_OFFSET) {
 	.text :  AT(ADDR(.text) - LOAD_OFFSET) {
+		_text = .;
+		/* bootstrapping code */
+		HEAD_TEXT
 #ifdef CONFIG_X86_32
 #ifdef CONFIG_X86_32
-		/* not really needed, already page aligned */
 		. = ALIGN(PAGE_SIZE);
 		. = ALIGN(PAGE_SIZE);
 		*(.text.page_aligned)
 		*(.text.page_aligned)
 #endif
 #endif