Commit 0f5c9064 authored by Sam Ravnborg's avatar Sam Ravnborg Committed by Ralf Baechle

[MIPS] Introduce a consistent style for vmlinux.lds.

This style will be consitent with all other arch's - soon.

In addition:
- Moved a few labels inside brackets for the sections they specify
  to prevent that linker alignmnet made them point before the section start
Signed-off-by: default avatarSam Ravnborg <sam@ravnborg.org>
Signed-off-by: default avatarRalf Baechle <ralf@linux-mips.org>
parent d5ab1a69
......@@ -6,6 +6,7 @@
OUTPUT_ARCH(mips)
ENTRY(kernel_entry)
jiffies = JIFFIES;
SECTIONS
{
#ifdef CONFIG_BOOT_ELF64
......@@ -16,8 +17,9 @@ SECTIONS
/* . = 0xc00000000001c000; */
/* Set the vaddr for the text segment to a value
>= 0xa800 0000 0001 9000 if no symmon is going to configured
>= 0xa800 0000 0030 0000 otherwise */
* >= 0xa800 0000 0001 9000 if no symmon is going to configured
* >= 0xa800 0000 0030 0000 otherwise
*/
/* . = 0xa800000000300000; */
/* . = 0xa800000000300000; */
......@@ -33,20 +35,22 @@ SECTIONS
*(.fixup)
*(.gnu.warning)
} =0
_etext = .; /* End of text section */
. = ALIGN(16); /* Exception table */
/* Exception table */
. = ALIGN(16);
__ex_table : {
__start___ex_table = .;
__ex_table : { *(__ex_table) }
*(__ex_table)
__stop___ex_table = .;
}
__start___dbe_table = .; /* Exception table for data bus errors */
__dbe_table : { *(__dbe_table) }
/* Exception table for data bus errors */
__dbe_table : {
__start___dbe_table = .;
*(__dbe_table)
__stop___dbe_table = .;
NOTES
}
RODATA
/* writeable */
......@@ -65,26 +69,34 @@ SECTIONS
*(.data.init_task)
DATA_DATA
CONSTRUCTORS
}
_gp = . + 0x8000;
.lit8 : { *(.lit8) }
.lit4 : { *(.lit4) }
.lit8 : {
*(.lit8)
}
.lit4 : {
*(.lit4)
}
/* We want the small data sections together, so single-instruction offsets
can access them all, and initialized data all before uninitialized, so
we can shorten the on-disk segment size. */
.sdata : { *(.sdata) }
.sdata : {
*(.sdata)
}
. = ALIGN(_PAGE_SIZE);
.data_nosave : {
__nosave_begin = .;
.data_nosave : { *(.data.nosave) }
*(.data.nosave)
}
. = ALIGN(_PAGE_SIZE);
__nosave_end = .;
. = ALIGN(32);
.data.cacheline_aligned : { *(.data.cacheline_aligned) }
.data.cacheline_aligned : {
*(.data.cacheline_aligned)
}
_edata = .; /* End of data section */
/* will be freed after init */
......@@ -95,31 +107,45 @@ SECTIONS
*(.init.text)
_einittext = .;
}
.init.data : { *(.init.data) }
.init.data : {
*(.init.data)
}
. = ALIGN(16);
.init.setup : {
__setup_start = .;
.init.setup : { *(.init.setup) }
*(.init.setup)
__setup_end = .;
}
__initcall_start = .;
.initcall.init : {
__initcall_start = .;
INITCALLS
}
__initcall_end = .;
}
.con_initcall.init : {
__con_initcall_start = .;
.con_initcall.init : { *(.con_initcall.init) }
*(.con_initcall.init)
__con_initcall_end = .;
}
SECURITY_INIT
/* .exit.text is discarded at runtime, not link time, to deal with
references from .rodata */
.exit.text : { *(.exit.text) }
.exit.data : { *(.exit.data) }
* references from .rodata
*/
.exit.text : {
*(.exit.text)
}
.exit.data : {
*(.exit.data)
}
#if defined(CONFIG_BLK_DEV_INITRD)
. = ALIGN(_PAGE_SIZE);
.init.ramfs : {
__initramfs_start = .;
.init.ramfs : { *(.init.ramfs) }
*(.init.ramfs)
__initramfs_end = .;
}
#endif
PERCPU(_PAGE_SIZE)
. = ALIGN(_PAGE_SIZE);
......@@ -151,18 +177,31 @@ SECTIONS
}
/* These mark the ABI of the kernel for debuggers. */
.mdebug.abi32 : { KEEP(*(.mdebug.abi32)) }
.mdebug.abi64 : { KEEP(*(.mdebug.abi64)) }
.mdebug.abi32 : {
KEEP(*(.mdebug.abi32))
}
.mdebug.abi64 : {
KEEP(*(.mdebug.abi64))
}
/* This is the MIPS specific mdebug section. */
.mdebug : { *(.mdebug) }
.mdebug : {
*(.mdebug)
}
STABS_DEBUG
DWARF_DEBUG
/* These must appear regardless of . */
.gptab.sdata : { *(.gptab.data) *(.gptab.sdata) }
.gptab.sbss : { *(.gptab.bss) *(.gptab.sbss) }
.note : { *(.note) }
.gptab.sdata : {
*(.gptab.data)
*(.gptab.sdata)
}
.gptab.sbss : {
*(.gptab.bss)
*(.gptab.sbss)
}
.note : {
*(.note)
}
}
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