Commit b9719a4d authored by Jeremy Fitzhardinge's avatar Jeremy Fitzhardinge Committed by H. Peter Anvin

x86: make section delimiter symbols part of their section

Impact: cleanup

Move the symbols delimiting a section part of the section
(section relative) rather than absolute.  This avoids any
unexpected gaps between the section-start symbol and the first
data in the section, which could be caused by implicit
alignment of the section data.  It also makes the general
form of vmlinux_64.lds.S consistent with vmlinux_32.lds.S.
Signed-off-by: default avatarJeremy Fitzhardinge <jeremy.fitzhardinge@citrix.com>
Cc: Yinghai Lu <yinghai@kernel.org>
Cc: "Eric W. Biederman" <ebiederm@xmission.com>
Signed-off-by: default avatarH. Peter Anvin <hpa@zytor.com>
parent c550033c
...@@ -29,8 +29,8 @@ SECTIONS ...@@ -29,8 +29,8 @@ SECTIONS
{ {
. = __START_KERNEL; . = __START_KERNEL;
phys_startup_64 = startup_64 - LOAD_OFFSET; phys_startup_64 = startup_64 - LOAD_OFFSET;
_text = .; /* Text and read-only data */
.text : AT(ADDR(.text) - LOAD_OFFSET) { .text : AT(ADDR(.text) - LOAD_OFFSET) {
_text = .; /* Text and read-only data */
/* First the code that has to be first for bootstrapping */ /* First the code that has to be first for bootstrapping */
*(.text.head) *(.text.head)
_stext = .; _stext = .;
...@@ -61,13 +61,13 @@ SECTIONS ...@@ -61,13 +61,13 @@ SECTIONS
.data : AT(ADDR(.data) - LOAD_OFFSET) { .data : AT(ADDR(.data) - LOAD_OFFSET) {
DATA_DATA DATA_DATA
CONSTRUCTORS CONSTRUCTORS
_edata = .; /* End of data section */
} :data } :data
_edata = .; /* End of data section */
.data.cacheline_aligned : AT(ADDR(.data.cacheline_aligned) - LOAD_OFFSET) {
. = ALIGN(PAGE_SIZE); . = ALIGN(PAGE_SIZE);
. = ALIGN(CONFIG_X86_L1_CACHE_BYTES); . = ALIGN(CONFIG_X86_L1_CACHE_BYTES);
.data.cacheline_aligned : AT(ADDR(.data.cacheline_aligned) - LOAD_OFFSET) {
*(.data.cacheline_aligned) *(.data.cacheline_aligned)
} }
. = ALIGN(CONFIG_X86_INTERNODE_CACHE_BYTES); . = ALIGN(CONFIG_X86_INTERNODE_CACHE_BYTES);
...@@ -125,29 +125,29 @@ SECTIONS ...@@ -125,29 +125,29 @@ SECTIONS
#undef VVIRT_OFFSET #undef VVIRT_OFFSET
#undef VVIRT #undef VVIRT
. = ALIGN(THREAD_SIZE); /* init_task */
.data.init_task : AT(ADDR(.data.init_task) - LOAD_OFFSET) { .data.init_task : AT(ADDR(.data.init_task) - LOAD_OFFSET) {
. = ALIGN(THREAD_SIZE); /* init_task */
*(.data.init_task) *(.data.init_task)
}:data.init }:data.init
. = ALIGN(PAGE_SIZE);
.data.page_aligned : AT(ADDR(.data.page_aligned) - LOAD_OFFSET) { .data.page_aligned : AT(ADDR(.data.page_aligned) - LOAD_OFFSET) {
. = ALIGN(PAGE_SIZE);
*(.data.page_aligned) *(.data.page_aligned)
} }
.smp_locks : AT(ADDR(.smp_locks) - LOAD_OFFSET) {
/* might get freed after init */ /* might get freed after init */
. = ALIGN(PAGE_SIZE); . = ALIGN(PAGE_SIZE);
__smp_alt_begin = .; __smp_alt_begin = .;
__smp_locks = .; __smp_locks = .;
.smp_locks : AT(ADDR(.smp_locks) - LOAD_OFFSET) {
*(.smp_locks) *(.smp_locks)
}
__smp_locks_end = .; __smp_locks_end = .;
. = ALIGN(PAGE_SIZE); . = ALIGN(PAGE_SIZE);
__smp_alt_end = .; __smp_alt_end = .;
}
. = ALIGN(PAGE_SIZE); /* Init code and data */ . = ALIGN(PAGE_SIZE); /* Init code and data */
__init_begin = .; __init_begin = .; /* paired with __init_end */
.init.text : AT(ADDR(.init.text) - LOAD_OFFSET) { .init.text : AT(ADDR(.init.text) - LOAD_OFFSET) {
_sinittext = .; _sinittext = .;
INIT_TEXT INIT_TEXT
...@@ -159,25 +159,27 @@ SECTIONS ...@@ -159,25 +159,27 @@ SECTIONS
__initdata_end = .; __initdata_end = .;
} }
.init.setup : AT(ADDR(.init.setup) - LOAD_OFFSET) {
. = ALIGN(16); . = ALIGN(16);
__setup_start = .; __setup_start = .;
.init.setup : AT(ADDR(.init.setup) - LOAD_OFFSET) { *(.init.setup) } *(.init.setup)
__setup_end = .; __setup_end = .;
__initcall_start = .; }
.initcall.init : AT(ADDR(.initcall.init) - LOAD_OFFSET) { .initcall.init : AT(ADDR(.initcall.init) - LOAD_OFFSET) {
__initcall_start = .;
INITCALLS INITCALLS
}
__initcall_end = .; __initcall_end = .;
__con_initcall_start = .; }
.con_initcall.init : AT(ADDR(.con_initcall.init) - LOAD_OFFSET) { .con_initcall.init : AT(ADDR(.con_initcall.init) - LOAD_OFFSET) {
__con_initcall_start = .;
*(.con_initcall.init) *(.con_initcall.init)
}
__con_initcall_end = .; __con_initcall_end = .;
__x86_cpu_dev_start = .; }
.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.init) *(.x86_cpu_dev.init)
}
__x86_cpu_dev_end = .; __x86_cpu_dev_end = .;
}
SECURITY_INIT SECURITY_INIT
. = ALIGN(8); . = ALIGN(8);
...@@ -187,12 +189,12 @@ SECTIONS ...@@ -187,12 +189,12 @@ SECTIONS
__parainstructions_end = .; __parainstructions_end = .;
} }
.altinstructions : AT(ADDR(.altinstructions) - LOAD_OFFSET) {
. = ALIGN(8); . = ALIGN(8);
__alt_instructions = .; __alt_instructions = .;
.altinstructions : AT(ADDR(.altinstructions) - LOAD_OFFSET) {
*(.altinstructions) *(.altinstructions)
}
__alt_instructions_end = .; __alt_instructions_end = .;
}
.altinstr_replacement : AT(ADDR(.altinstr_replacement) - LOAD_OFFSET) { .altinstr_replacement : AT(ADDR(.altinstr_replacement) - LOAD_OFFSET) {
*(.altinstr_replacement) *(.altinstr_replacement)
} }
...@@ -207,9 +209,11 @@ SECTIONS ...@@ -207,9 +209,11 @@ SECTIONS
#ifdef CONFIG_BLK_DEV_INITRD #ifdef CONFIG_BLK_DEV_INITRD
. = ALIGN(PAGE_SIZE); . = ALIGN(PAGE_SIZE);
.init.ramfs : AT(ADDR(.init.ramfs) - LOAD_OFFSET) {
__initramfs_start = .; __initramfs_start = .;
.init.ramfs : AT(ADDR(.init.ramfs) - LOAD_OFFSET) { *(.init.ramfs) } *(.init.ramfs)
__initramfs_end = .; __initramfs_end = .;
}
#endif #endif
#ifdef CONFIG_SMP #ifdef CONFIG_SMP
...@@ -229,20 +233,21 @@ SECTIONS ...@@ -229,20 +233,21 @@ SECTIONS
. = ALIGN(PAGE_SIZE); . = ALIGN(PAGE_SIZE);
__init_end = .; __init_end = .;
.data_nosave : AT(ADDR(.data_nosave) - LOAD_OFFSET) {
. = ALIGN(PAGE_SIZE); . = ALIGN(PAGE_SIZE);
__nosave_begin = .; __nosave_begin = .;
.data_nosave : AT(ADDR(.data_nosave) - LOAD_OFFSET) {
*(.data.nosave) *(.data.nosave)
} :data.init2 /* use another section data.init2, see PERCPU_VADDR() above */
. = ALIGN(PAGE_SIZE); . = ALIGN(PAGE_SIZE);
__nosave_end = .; __nosave_end = .;
} :data.init2 /* use another section data.init2, see PERCPU_VADDR() above */
__bss_start = .; /* BSS */
.bss : AT(ADDR(.bss) - LOAD_OFFSET) { .bss : AT(ADDR(.bss) - LOAD_OFFSET) {
. = ALIGN(PAGE_SIZE);
__bss_start = .; /* BSS */
*(.bss.page_aligned) *(.bss.page_aligned)
*(.bss) *(.bss)
}
__bss_stop = .; __bss_stop = .;
}
_end = . ; _end = . ;
......
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