Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 1 | /* ld script to make the Linux/CRIS kernel |
| 2 | * Authors: Bjorn Wesen (bjornw@axis.com) |
| 3 | * |
| 4 | * It is VERY DANGEROUS to fiddle around with the symbols in this |
| 5 | * script. It is for example quite vital that all generated sections |
| 6 | * that are used are actually named here, otherwise the linker will |
| 7 | * put them at the end, where the init stuff is which is FREED after |
| 8 | * the kernel has booted. |
| 9 | */ |
| 10 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 11 | #include <asm-generic/vmlinux.lds.h> |
Jesper Nilsson | b0e86f0 | 2008-01-17 15:21:11 -0800 | [diff] [blame] | 12 | #include <asm/page.h> |
| 13 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 14 | jiffies = jiffies_64; |
| 15 | SECTIONS |
| 16 | { |
| 17 | . = DRAM_VIRTUAL_BASE; |
| 18 | dram_start = .; |
| 19 | ibr_start = .; |
| 20 | . = . + 0x4000; /* see head.S and pages reserved at the start */ |
| 21 | |
| 22 | _text = .; /* Text and read-only data */ |
| 23 | text_start = .; /* lots of aliases */ |
| 24 | _stext = .; |
| 25 | __stext = .; |
| 26 | .text : { |
Jesper Nilsson | b0e86f0 | 2008-01-17 15:21:11 -0800 | [diff] [blame] | 27 | TEXT_TEXT |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 28 | SCHED_TEXT |
| 29 | LOCK_TEXT |
| 30 | *(.fixup) |
| 31 | *(.text.__*) |
| 32 | } |
| 33 | |
| 34 | _etext = . ; /* End of text section */ |
| 35 | __etext = .; |
| 36 | |
| 37 | . = ALIGN(4); /* Exception table */ |
| 38 | __start___ex_table = .; |
| 39 | __ex_table : { *(__ex_table) } |
| 40 | __stop___ex_table = .; |
| 41 | |
| 42 | RODATA |
| 43 | |
| 44 | . = ALIGN (4); |
| 45 | ___data_start = . ; |
| 46 | __Sdata = . ; |
| 47 | .data : { /* Data */ |
Mathieu Desnoyers | 5c617c6 | 2007-06-16 22:28:26 -0400 | [diff] [blame] | 48 | DATA_DATA |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 49 | } |
| 50 | __edata = . ; /* End of data section */ |
| 51 | _edata = . ; |
| 52 | |
Jesper Nilsson | b0e86f0 | 2008-01-17 15:21:11 -0800 | [diff] [blame] | 53 | . = ALIGN(PAGE_SIZE); /* init_task and stack, must be aligned */ |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 54 | .data.init_task : { *(.data.init_task) } |
| 55 | |
Jesper Nilsson | b0e86f0 | 2008-01-17 15:21:11 -0800 | [diff] [blame] | 56 | . = ALIGN(PAGE_SIZE); /* Init code and data */ |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 57 | __init_begin = .; |
| 58 | .init.text : { |
| 59 | _sinittext = .; |
Sam Ravnborg | 01ba2bd | 2008-01-20 14:15:03 +0100 | [diff] [blame] | 60 | INIT_TEXT |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 61 | _einittext = .; |
| 62 | } |
Sam Ravnborg | 01ba2bd | 2008-01-20 14:15:03 +0100 | [diff] [blame] | 63 | .init.data : { INIT_DATA } |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 64 | . = ALIGN(16); |
| 65 | __setup_start = .; |
| 66 | .init.setup : { *(.init.setup) } |
| 67 | __setup_end = .; |
| 68 | .initcall.init : { |
| 69 | __initcall_start = .; |
Jesper Nilsson | b0e86f0 | 2008-01-17 15:21:11 -0800 | [diff] [blame] | 70 | INITCALLS |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 71 | __initcall_end = .; |
| 72 | } |
| 73 | |
| 74 | .con_initcall.init : { |
| 75 | __con_initcall_start = .; |
| 76 | *(.con_initcall.init) |
| 77 | __con_initcall_end = .; |
| 78 | } |
| 79 | SECURITY_INIT |
Jean-Paul Saman | 67d3822 | 2007-02-10 01:44:44 -0800 | [diff] [blame] | 80 | |
| 81 | #ifdef CONFIG_BLK_DEV_INITRD |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 82 | .init.ramfs : { |
| 83 | __initramfs_start = .; |
| 84 | *(.init.ramfs) |
| 85 | __initramfs_end = .; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 86 | } |
Jean-Paul Saman | 67d3822 | 2007-02-10 01:44:44 -0800 | [diff] [blame] | 87 | #endif |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 88 | __vmlinux_end = .; /* last address of the physical file */ |
Jesper Nilsson | b0e86f0 | 2008-01-17 15:21:11 -0800 | [diff] [blame] | 89 | |
| 90 | /* |
| 91 | * We fill to the next page, so we can discard all init |
| 92 | * pages without needing to consider what payload might be |
| 93 | * appended to the kernel image. |
| 94 | */ |
| 95 | . = ALIGN(PAGE_SIZE); |
| 96 | |
| 97 | __init_end = .; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 98 | |
| 99 | __data_end = . ; /* Move to _edata ? */ |
| 100 | __bss_start = .; /* BSS */ |
| 101 | .bss : { |
| 102 | *(COMMON) |
| 103 | *(.bss) |
| 104 | } |
| 105 | |
| 106 | . = ALIGN (0x20); |
| 107 | _end = .; |
| 108 | __end = .; |
| 109 | |
| 110 | /* Sections to be discarded */ |
| 111 | /DISCARD/ : { |
Sam Ravnborg | 01ba2bd | 2008-01-20 14:15:03 +0100 | [diff] [blame] | 112 | EXIT_TEXT |
| 113 | EXIT_DATA |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 114 | *(.exitcall.exit) |
| 115 | } |
| 116 | |
| 117 | dram_end = dram_start + CONFIG_ETRAX_DRAM_SIZE*1024*1024; |
| 118 | } |