Commit c7ec16da authored by Jeff Dike's avatar Jeff Dike Committed by Linus Torvalds

uml: fix linker script alignment bugs

Fix a class of bugs in the UML linker scripts which caused section boundary
variables to sometimes not line up with their sections.
Signed-off-by: default avatarJeff Dike <jdike@linux.intel.com>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent 64191688
...@@ -71,11 +71,13 @@ SECTIONS ...@@ -71,11 +71,13 @@ SECTIONS
*(.gnu.warning) *(.gnu.warning)
. = ALIGN(4096); . = ALIGN(4096);
} =0x90909090
. = ALIGN(4096);
.syscall_stub : {
__syscall_stub_start = .; __syscall_stub_start = .;
*(.__syscall_stub*) *(.__syscall_stub*)
__syscall_stub_end = .; __syscall_stub_end = .;
. = ALIGN(4096); }
} =0x90909090
.fini : { .fini : {
KEEP (*(.fini)) KEEP (*(.fini))
} =0x90909090 } =0x90909090
...@@ -138,8 +140,8 @@ SECTIONS ...@@ -138,8 +140,8 @@ SECTIONS
.got : { *(.got.plt) *(.got) } .got : { *(.got.plt) *(.got) }
_edata = .; _edata = .;
PROVIDE (edata = .); PROVIDE (edata = .);
__bss_start = .;
.bss : { .bss : {
__bss_start = .;
*(.dynbss) *(.dynbss)
*(.bss .bss.* .gnu.linkonce.b.*) *(.bss .bss.* .gnu.linkonce.b.*)
*(COMMON) *(COMMON)
......
...@@ -44,12 +44,13 @@ SECTIONS ...@@ -44,12 +44,13 @@ SECTIONS
/* .gnu.warning sections are handled specially by elf32.em. */ /* .gnu.warning sections are handled specially by elf32.em. */
*(.gnu.warning) *(.gnu.warning)
*(.gnu.linkonce.t*) *(.gnu.linkonce.t*)
}
. = ALIGN(4096); . = ALIGN(4096);
.syscall_stub : {
__syscall_stub_start = .; __syscall_stub_start = .;
*(.__syscall_stub*) *(.__syscall_stub*)
__syscall_stub_end = .; __syscall_stub_end = .;
. = ALIGN(4096);
} }
#include "asm/common.lds.S" #include "asm/common.lds.S"
......
...@@ -16,82 +16,112 @@ ...@@ -16,82 +16,112 @@
. = ALIGN(4096); . = ALIGN(4096);
.note : { *(.note.*) } .note : { *(.note.*) }
__ex_table : {
__start___ex_table = .; __start___ex_table = .;
__ex_table : { *(__ex_table) } *(__ex_table)
__stop___ex_table = .; __stop___ex_table = .;
}
BUG_TABLE BUG_TABLE
.uml.setup.init : {
__uml_setup_start = .; __uml_setup_start = .;
.uml.setup.init : { *(.uml.setup.init) } *(.uml.setup.init)
__uml_setup_end = .; __uml_setup_end = .;
}
.uml.help.init : {
__uml_help_start = .; __uml_help_start = .;
.uml.help.init : { *(.uml.help.init) } *(.uml.help.init)
__uml_help_end = .; __uml_help_end = .;
}
.uml.postsetup.init : {
__uml_postsetup_start = .; __uml_postsetup_start = .;
.uml.postsetup.init : { *(.uml.postsetup.init) } *(.uml.postsetup.init)
__uml_postsetup_end = .; __uml_postsetup_end = .;
}
.init.setup : {
__setup_start = .; __setup_start = .;
.init.setup : { *(.init.setup) } *(.init.setup)
__setup_end = .; __setup_end = .;
}
. = ALIGN(32); . = ALIGN(32);
.data.percpu : {
__per_cpu_start = . ; __per_cpu_start = . ;
.data.percpu : { *(.data.percpu) } *(.data.percpu)
__per_cpu_end = . ; __per_cpu_end = . ;
}
__initcall_start = .;
.initcall.init : { .initcall.init : {
__initcall_start = .;
INITCALLS INITCALLS
}
__initcall_end = .; __initcall_end = .;
}
.con_initcall.init : {
__con_initcall_start = .; __con_initcall_start = .;
.con_initcall.init : { *(.con_initcall.init) } *(.con_initcall.init)
__con_initcall_end = .; __con_initcall_end = .;
}
.uml.initcall.init : {
__uml_initcall_start = .; __uml_initcall_start = .;
.uml.initcall.init : { *(.uml.initcall.init) } *(.uml.initcall.init)
__uml_initcall_end = .; __uml_initcall_end = .;
}
__init_end = .; __init_end = .;
SECURITY_INIT SECURITY_INIT
.exitcall : {
__exitcall_begin = .; __exitcall_begin = .;
.exitcall : { *(.exitcall.exit) } *(.exitcall.exit)
__exitcall_end = .; __exitcall_end = .;
}
.uml.exitcall : {
__uml_exitcall_begin = .; __uml_exitcall_begin = .;
.uml.exitcall : { *(.uml.exitcall.exit) } *(.uml.exitcall.exit)
__uml_exitcall_end = .; __uml_exitcall_end = .;
}
. = ALIGN(4); . = ALIGN(4);
.altinstructions : {
__alt_instructions = .; __alt_instructions = .;
.altinstructions : { *(.altinstructions) } *(.altinstructions)
__alt_instructions_end = .; __alt_instructions_end = .;
}
.altinstr_replacement : { *(.altinstr_replacement) } .altinstr_replacement : { *(.altinstr_replacement) }
/* .exit.text is discard at runtime, not link time, to deal with references /* .exit.text is discard at runtime, not link time, to deal with references
from .altinstructions and .eh_frame */ from .altinstructions and .eh_frame */
.exit.text : { *(.exit.text) } .exit.text : { *(.exit.text) }
.exit.data : { *(.exit.data) } .exit.data : { *(.exit.data) }
.preinit_array : {
__preinit_array_start = .; __preinit_array_start = .;
.preinit_array : { *(.preinit_array) } *(.preinit_array)
__preinit_array_end = .; __preinit_array_end = .;
}
.init_array : {
__init_array_start = .; __init_array_start = .;
.init_array : { *(.init_array) } *(.init_array)
__init_array_end = .; __init_array_end = .;
}
.fini_array : {
__fini_array_start = .; __fini_array_start = .;
.fini_array : { *(.fini_array) } *(.fini_array)
__fini_array_end = .; __fini_array_end = .;
}
. = ALIGN(4096); . = ALIGN(4096);
.init.ramfs : {
__initramfs_start = .; __initramfs_start = .;
.init.ramfs : { *(.init.ramfs) } *(.init.ramfs)
__initramfs_end = .; __initramfs_end = .;
}
/* Sections to be discarded */ /* Sections to be discarded */
/DISCARD/ : { /DISCARD/ : {
......
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