Commit 704daf55 authored by Ingo Molnar's avatar Ingo Molnar

Merge branch 'x86/asm' into x86/urgent

Merge reason: The linker script cleanups are ready for upstream.
Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
parents b0c6fbe4 123f3e1d
...@@ -23,13 +23,14 @@ ...@@ -23,13 +23,14 @@
*/ */
.text .text
#include <linux/init.h>
#include <linux/linkage.h> #include <linux/linkage.h>
#include <asm/segment.h> #include <asm/segment.h>
#include <asm/page_types.h> #include <asm/page_types.h>
#include <asm/boot.h> #include <asm/boot.h>
#include <asm/asm-offsets.h> #include <asm/asm-offsets.h>
.section ".text.head","ax",@progbits __HEAD
ENTRY(startup_32) ENTRY(startup_32)
cld cld
/* /*
......
...@@ -24,6 +24,7 @@ ...@@ -24,6 +24,7 @@
.code32 .code32
.text .text
#include <linux/init.h>
#include <linux/linkage.h> #include <linux/linkage.h>
#include <asm/segment.h> #include <asm/segment.h>
#include <asm/pgtable_types.h> #include <asm/pgtable_types.h>
...@@ -33,7 +34,7 @@ ...@@ -33,7 +34,7 @@
#include <asm/processor-flags.h> #include <asm/processor-flags.h>
#include <asm/asm-offsets.h> #include <asm/asm-offsets.h>
.section ".text.head" __HEAD
.code32 .code32
ENTRY(startup_32) ENTRY(startup_32)
cld cld
......
#include <asm-generic/vmlinux.lds.h>
OUTPUT_FORMAT(CONFIG_OUTPUT_FORMAT, CONFIG_OUTPUT_FORMAT, CONFIG_OUTPUT_FORMAT) OUTPUT_FORMAT(CONFIG_OUTPUT_FORMAT, CONFIG_OUTPUT_FORMAT, CONFIG_OUTPUT_FORMAT)
#undef i386 #undef i386
...@@ -18,9 +20,9 @@ SECTIONS ...@@ -18,9 +20,9 @@ SECTIONS
* address 0. * address 0.
*/ */
. = 0; . = 0;
.text.head : { .head.text : {
_head = . ; _head = . ;
*(.text.head) HEAD_TEXT
_ehead = . ; _ehead = . ;
} }
.rodata.compressed : { .rodata.compressed : {
......
...@@ -79,7 +79,7 @@ RESERVE_BRK(pagetables, INIT_MAP_SIZE) ...@@ -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 */
......
...@@ -40,7 +40,7 @@ L4_START_KERNEL = pgd_index(__START_KERNEL_map) ...@@ -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:
......
...@@ -73,11 +73,9 @@ char ignore_fpu_irq; ...@@ -73,11 +73,9 @@ char ignore_fpu_irq;
/* /*
* The IDT has to be page-aligned to simplify the Pentium * The IDT has to be page-aligned to simplify the Pentium
* F0 0F bug workaround.. We have a special link segment * F0 0F bug workaround.
* for this.
*/ */
gate_desc idt_table[NR_VECTORS] gate_desc idt_table[NR_VECTORS] __page_aligned_data = { { { { 0, 0 } } }, };
__attribute__((__section__(".data.idt"))) = { { { { 0, 0 } } }, };
#endif #endif
DECLARE_BITMAP(used_vectors, NR_VECTORS); DECLARE_BITMAP(used_vectors, NR_VECTORS);
......
...@@ -65,17 +65,11 @@ SECTIONS ...@@ -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
...@@ -94,13 +88,7 @@ SECTIONS ...@@ -94,13 +88,7 @@ SECTIONS
NOTES :text :note NOTES :text :note
/* Exception table */ EXCEPTION_TABLE(16) :text = 0x9090
. = ALIGN(16);
__ex_table : AT(ADDR(__ex_table) - LOAD_OFFSET) {
__start___ex_table = .;
*(__ex_table)
__stop___ex_table = .;
} :text = 0x9090
RO_DATA(PAGE_SIZE) RO_DATA(PAGE_SIZE)
...@@ -118,7 +106,6 @@ SECTIONS ...@@ -118,7 +106,6 @@ SECTIONS
#endif #endif
PAGE_ALIGNED_DATA(PAGE_SIZE) PAGE_ALIGNED_DATA(PAGE_SIZE)
*(.data.idt)
CACHELINE_ALIGNED_DATA(CONFIG_X86_L1_CACHE_BYTES) CACHELINE_ALIGNED_DATA(CONFIG_X86_L1_CACHE_BYTES)
...@@ -135,24 +122,21 @@ SECTIONS ...@@ -135,24 +122,21 @@ SECTIONS
#ifdef CONFIG_X86_64 #ifdef CONFIG_X86_64
#define VSYSCALL_ADDR (-10*1024*1024) #define VSYSCALL_ADDR (-10*1024*1024)
#define VSYSCALL_PHYS_ADDR ((LOADADDR(.data) + SIZEOF(.data) + \
PAGE_SIZE - 1) & ~(PAGE_SIZE - 1))
#define VSYSCALL_VIRT_ADDR ((ADDR(.data) + SIZEOF(.data) + \
PAGE_SIZE - 1) & ~(PAGE_SIZE - 1))
#define VLOAD_OFFSET (VSYSCALL_ADDR - VSYSCALL_PHYS_ADDR) #define VLOAD_OFFSET (VSYSCALL_ADDR - __vsyscall_0 + LOAD_OFFSET)
#define VLOAD(x) (ADDR(x) - VLOAD_OFFSET) #define VLOAD(x) (ADDR(x) - VLOAD_OFFSET)
#define VVIRT_OFFSET (VSYSCALL_ADDR - VSYSCALL_VIRT_ADDR) #define VVIRT_OFFSET (VSYSCALL_ADDR - __vsyscall_0)
#define VVIRT(x) (ADDR(x) - VVIRT_OFFSET) #define VVIRT(x) (ADDR(x) - VVIRT_OFFSET)
. = ALIGN(4096);
__vsyscall_0 = .;
. = VSYSCALL_ADDR; . = VSYSCALL_ADDR;
.vsyscall_0 : AT(VSYSCALL_PHYS_ADDR) { .vsyscall_0 : AT(VLOAD(.vsyscall_0)) {
*(.vsyscall_0) *(.vsyscall_0)
} :user } :user
__vsyscall_0 = VSYSCALL_VIRT_ADDR;
. = ALIGN(CONFIG_X86_L1_CACHE_BYTES); . = ALIGN(CONFIG_X86_L1_CACHE_BYTES);
.vsyscall_fn : AT(VLOAD(.vsyscall_fn)) { .vsyscall_fn : AT(VLOAD(.vsyscall_fn)) {
*(.vsyscall_fn) *(.vsyscall_fn)
...@@ -192,11 +176,9 @@ SECTIONS ...@@ -192,11 +176,9 @@ SECTIONS
*(.vsyscall_3) *(.vsyscall_3)
} }
. = VSYSCALL_VIRT_ADDR + PAGE_SIZE; . = __vsyscall_0 + PAGE_SIZE;
#undef VSYSCALL_ADDR #undef VSYSCALL_ADDR
#undef VSYSCALL_PHYS_ADDR
#undef VSYSCALL_VIRT_ADDR
#undef VLOAD_OFFSET #undef VLOAD_OFFSET
#undef VLOAD #undef VLOAD
#undef VVIRT_OFFSET #undef VVIRT_OFFSET
...@@ -219,36 +201,12 @@ SECTIONS ...@@ -219,36 +201,12 @@ SECTIONS
PERCPU_VADDR(0, :percpu) PERCPU_VADDR(0, :percpu)
#endif #endif
.init.text : AT(ADDR(.init.text) - LOAD_OFFSET) { INIT_TEXT_SECTION(PAGE_SIZE)
_sinittext = .;
INIT_TEXT
_einittext = .;
}
#ifdef CONFIG_X86_64 #ifdef CONFIG_X86_64
:init :init
#endif #endif
.init.data : AT(ADDR(.init.data) - LOAD_OFFSET) { INIT_DATA_SECTION(16)
INIT_DATA
}
. = ALIGN(16);
.init.setup : AT(ADDR(.init.setup) - LOAD_OFFSET) {
__setup_start = .;
*(.init.setup)
__setup_end = .;
}
.initcall.init : AT(ADDR(.initcall.init) - LOAD_OFFSET) {
__initcall_start = .;
INITCALLS
__initcall_end = .;
}
.con_initcall.init : AT(ADDR(.con_initcall.init) - LOAD_OFFSET) {
__con_initcall_start = .;
*(.con_initcall.init)
__con_initcall_end = .;
}
.x86_cpu_dev.init : AT(ADDR(.x86_cpu_dev.init) - LOAD_OFFSET) { .x86_cpu_dev.init : AT(ADDR(.x86_cpu_dev.init) - LOAD_OFFSET) {
__x86_cpu_dev_start = .; __x86_cpu_dev_start = .;
...@@ -256,8 +214,6 @@ SECTIONS ...@@ -256,8 +214,6 @@ SECTIONS
__x86_cpu_dev_end = .; __x86_cpu_dev_end = .;
} }
SECURITY_INIT
. = ALIGN(8); . = ALIGN(8);
.parainstructions : AT(ADDR(.parainstructions) - LOAD_OFFSET) { .parainstructions : AT(ADDR(.parainstructions) - LOAD_OFFSET) {
__parainstructions = .; __parainstructions = .;
...@@ -288,15 +244,6 @@ SECTIONS ...@@ -288,15 +244,6 @@ SECTIONS
EXIT_DATA EXIT_DATA
} }
#ifdef CONFIG_BLK_DEV_INITRD
. = ALIGN(PAGE_SIZE);
.init.ramfs : AT(ADDR(.init.ramfs) - LOAD_OFFSET) {
__initramfs_start = .;
*(.init.ramfs)
__initramfs_end = .;
}
#endif
#if !defined(CONFIG_X86_64) || !defined(CONFIG_SMP) #if !defined(CONFIG_X86_64) || !defined(CONFIG_SMP)
PERCPU(PAGE_SIZE) PERCPU(PAGE_SIZE)
#endif #endif
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment