diff options
Diffstat (limited to 'arch/arm/kernel/vmlinux.lds.S')
-rw-r--r-- | arch/arm/kernel/vmlinux.lds.S | 144 |
1 files changed, 64 insertions, 80 deletions
diff --git a/arch/arm/kernel/vmlinux.lds.S b/arch/arm/kernel/vmlinux.lds.S index 20b3041..e5287f2 100644 --- a/arch/arm/kernel/vmlinux.lds.S +++ b/arch/arm/kernel/vmlinux.lds.S @@ -21,13 +21,10 @@ #define ARM_CPU_KEEP(x) #endif -#if (defined(CONFIG_SMP_ON_UP) && !defined(CONFIG_DEBUG_SPINLOCK)) || \ - defined(CONFIG_GENERIC_BUG) +#if defined(CONFIG_SMP_ON_UP) && !defined(CONFIG_DEBUG_SPINLOCK) #define ARM_EXIT_KEEP(x) x -#define ARM_EXIT_DISCARD(x) #else #define ARM_EXIT_KEEP(x) -#define ARM_EXIT_DISCARD(x) x #endif OUTPUT_ARCH(arm) @@ -41,12 +38,58 @@ jiffies = jiffies_64 + 4; SECTIONS { +#ifdef CONFIG_XIP_KERNEL + . = XIP_VIRT_ADDR(CONFIG_XIP_PHYS_ADDR); +#else + . = PAGE_OFFSET + TEXT_OFFSET; +#endif + + .init : { /* Init code and data */ + _stext = .; + _sinittext = .; + HEAD_TEXT + INIT_TEXT + ARM_EXIT_KEEP(EXIT_TEXT) + _einittext = .; + ARM_CPU_DISCARD(PROC_INFO) + __arch_info_begin = .; + *(.arch.info.init) + __arch_info_end = .; + __tagtable_begin = .; + *(.taglist.init) + __tagtable_end = .; +#ifdef CONFIG_SMP_ON_UP + __smpalt_begin = .; + *(.alt.smp.init) + __smpalt_end = .; +#endif + + __pv_table_begin = .; + *(.pv_table) + __pv_table_end = .; + + INIT_SETUP(16) + + INIT_CALLS + CON_INITCALL + SECURITY_INITCALL + INIT_RAM_FS + +#ifndef CONFIG_XIP_KERNEL + __init_begin = _stext; + INIT_DATA + ARM_EXIT_KEEP(EXIT_DATA) +#endif + } + + PERCPU_SECTION(32) + +#ifndef CONFIG_XIP_KERNEL + . = ALIGN(PAGE_SIZE); + __init_end = .; +#endif + /* - * XXX: The linker does not define how output sections are - * assigned to input sections when there are multiple statements - * matching the same input section name. There is no documented - * order of matching. - * * unwind exit sections must be discarded before the rest of the * unwind sections get included. */ @@ -55,9 +98,6 @@ SECTIONS *(.ARM.extab.exit.text) ARM_CPU_DISCARD(*(.ARM.exidx.cpuexit.text)) ARM_CPU_DISCARD(*(.ARM.extab.cpuexit.text)) - ARM_EXIT_DISCARD(EXIT_TEXT) - ARM_EXIT_DISCARD(EXIT_DATA) - EXIT_CALL #ifndef CONFIG_HOTPLUG *(.ARM.exidx.devexit.text) *(.ARM.extab.devexit.text) @@ -66,24 +106,10 @@ SECTIONS *(.fixup) *(__ex_table) #endif -#ifndef CONFIG_SMP_ON_UP - *(.alt.smp.init) -#endif - *(.discard) - *(.discard.*) } -#ifdef CONFIG_XIP_KERNEL - . = XIP_VIRT_ADDR(CONFIG_XIP_PHYS_ADDR); -#else - . = PAGE_OFFSET + TEXT_OFFSET; -#endif - .head.text : { - _text = .; - HEAD_TEXT - } .text : { /* Real text segment */ - _stext = .; /* Text and read-only data */ + _text = .; /* Text and read-only data */ __exception_text_start = .; *(.exception.text) __exception_text_end = .; @@ -96,6 +122,8 @@ SECTIONS *(.fixup) #endif *(.gnu.warning) + *(.rodata) + *(.rodata.*) *(.glue_7) *(.glue_7t) . = ALIGN(4); @@ -124,63 +152,10 @@ SECTIONS _etext = .; /* End of text and rodata section */ -#ifndef CONFIG_XIP_KERNEL - . = ALIGN(PAGE_SIZE); - __init_begin = .; -#endif - - INIT_TEXT_SECTION(8) - .exit.text : { - ARM_EXIT_KEEP(EXIT_TEXT) - } - .init.proc.info : { - ARM_CPU_DISCARD(PROC_INFO) - } - .init.arch.info : { - __arch_info_begin = .; - *(.arch.info.init) - __arch_info_end = .; - } - .init.tagtable : { - __tagtable_begin = .; - *(.taglist.init) - __tagtable_end = .; - } -#ifdef CONFIG_SMP_ON_UP - .init.smpalt : { - __smpalt_begin = .; - *(.alt.smp.init) - __smpalt_end = .; - } -#endif - .init.pv_table : { - __pv_table_begin = .; - *(.pv_table) - __pv_table_end = .; - } - .init.data : { -#ifndef CONFIG_XIP_KERNEL - INIT_DATA -#endif - INIT_SETUP(16) - INIT_CALLS - CON_INITCALL - SECURITY_INITCALL - INIT_RAM_FS - } -#ifndef CONFIG_XIP_KERNEL - .exit.data : { - ARM_EXIT_KEEP(EXIT_DATA) - } -#endif - - PERCPU_SECTION(32) - #ifdef CONFIG_XIP_KERNEL __data_loc = ALIGN(4); /* location in binary */ . = PAGE_OFFSET + TEXT_OFFSET; #else - __init_end = .; . = ALIGN(THREAD_SIZE); __data_loc = .; #endif @@ -292,6 +267,15 @@ SECTIONS STABS_DEBUG .comment 0 : { *(.comment) } + + /* Default discards */ + DISCARDS + +#ifndef CONFIG_SMP_ON_UP + /DISCARD/ : { + *(.alt.smp.init) + } +#endif } /* |