Linux-2.6.12-rc2
[linux-2.6/linux-acpi-2.6/ibm-acpi-2.6.git] / arch / sh64 / boot / compressed / vmlinux.lds.S
blob15a737d9bba8327a76a0779222b6e9e8960b290a
1 /*
2  * ld script to make compressed SuperH/shmedia Linux kernel+decompression
3  *              bootstrap
4  * Modified by Stuart Menefy from arch/sh/vmlinux.lds.S written by Niibe Yutaka
5  */
7 #include <linux/config.h>
9 #ifdef CONFIG_LITTLE_ENDIAN
10 /* OUTPUT_FORMAT("elf32-sh64l-linux", "elf32-sh64l-linux", "elf32-sh64l-linux") */
11 #define NOP 0x6ff0fff0
12 #else
13 /* OUTPUT_FORMAT("elf32-sh64", "elf32-sh64", "elf32-sh64") */
14 #define NOP 0xf0fff06f
15 #endif
17 OUTPUT_FORMAT("elf32-sh64-linux")
18 OUTPUT_ARCH(sh)
19 ENTRY(_start)
21 #define ALIGNED_GAP(section, align) (((ADDR(section)+SIZEOF(section)+(align)-1) & ~((align)-1))-ADDR(section))
22 #define FOLLOWING(section, align) AT (LOADADDR(section) + ALIGNED_GAP(section,align))
24 SECTIONS
26   _text = .;                    /* Text and read-only data */
28   .text : {
29         *(.text)
30         *(.text64)
31         *(.text..SHmedia32)
32         *(.fixup)
33         *(.gnu.warning)
34         } = NOP
35   . = ALIGN(4);
36   .rodata : { *(.rodata) }
38   /* There is no 'real' reason for eight byte alignment, four would work
39    * as well, but gdb downloads much (*4) faster with this.
40    */
41   . = ALIGN(8);
42   .image : { *(.image) }
43   . = ALIGN(4);
44   _etext = .;                   /* End of text section */
46   .data :                       /* Data */
47         FOLLOWING(.image, 4)
48         {
49         _data = .;
50         *(.data)
51         }
52   _data_image = LOADADDR(.data);/* Address of data section in ROM */
54   _edata = .;                   /* End of data section */
56   .stack : { stack = .;  _stack = .; }
58   . = ALIGN(4);
59   __bss_start = .;              /* BSS */
60   .bss : {
61         *(.bss)
62         }
63   . = ALIGN(4);
64   _end = . ;