ARM: 8067/1: zImage: ensure header in LE format for BE8 kernels
[linux-2.6/btrfs-unstable.git] / arch / arm / boot / compressed / vmlinux.lds.in
blob60162231c7eafe5c61e9dad2469b3d366ebe9b54
1 /*
2  *  linux/arch/arm/boot/compressed/vmlinux.lds.in
3  *
4  *  Copyright (C) 2000 Russell King
5  *
6  * This program is free software; you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License version 2 as
8  * published by the Free Software Foundation.
9  */
11 #ifdef CONFIG_CPU_ENDIAN_BE8
12 #define ZIMAGE_MAGIC(x) ( (((x) >> 24) & 0x000000ff) | \
13                           (((x) >>  8) & 0x0000ff00) | \
14                           (((x) <<  8) & 0x00ff0000) | \
15                           (((x) << 24) & 0xff000000) )
16 #else
17 #define ZIMAGE_MAGIC(x) (x)
18 #endif
20 OUTPUT_ARCH(arm)
21 ENTRY(_start)
22 SECTIONS
24   /DISCARD/ : {
25     *(.ARM.exidx*)
26     *(.ARM.extab*)
27     /*
28      * Discard any r/w data - this produces a link error if we have any,
29      * which is required for PIC decompression.  Local data generates
30      * GOTOFF relocations, which prevents it being relocated independently
31      * of the text/got segments.
32      */
33     *(.data)
34   }
36   . = TEXT_START;
37   _text = .;
39   .text : {
40     _start = .;
41     *(.start)
42     *(.text)
43     *(.text.*)
44     *(.fixup)
45     *(.gnu.warning)
46     *(.glue_7t)
47     *(.glue_7)
48   }
49   .rodata : {
50     *(.rodata)
51     *(.rodata.*)
52   }
53   .piggydata : {
54     *(.piggydata)
55   }
57   . = ALIGN(4);
58   _etext = .;
60   .got.plt              : { *(.got.plt) }
61   _got_start = .;
62   .got                  : { *(.got) }
63   _got_end = .;
65   /* ensure the zImage file size is always a multiple of 64 bits */
66   /* (without a dummy byte, ld just ignores the empty section) */
67   .pad                  : { BYTE(0); . = ALIGN(8); }
68   _edata = .;
70   _magic_sig = ZIMAGE_MAGIC(0x016f2818);
71   _magic_start = ZIMAGE_MAGIC(_start);
72   _magic_end = ZIMAGE_MAGIC(_edata);
74   . = BSS_START;
75   __bss_start = .;
76   .bss                  : { *(.bss) }
77   _end = .;
79   . = ALIGN(8);         /* the stack must be 64-bit aligned */
80   .stack                : { *(.stack) }
82   .stab 0               : { *(.stab) }
83   .stabstr 0            : { *(.stabstr) }
84   .stab.excl 0          : { *(.stab.excl) }
85   .stab.exclstr 0       : { *(.stab.exclstr) }
86   .stab.index 0         : { *(.stab.index) }
87   .stab.indexstr 0      : { *(.stab.indexstr) }
88   .comment 0            : { *(.comment) }