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