Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 1 | /* |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 2 | * Copyright (C) 2000 Russell King |
| 3 | * |
| 4 | * This program is free software; you can redistribute it and/or modify |
| 5 | * it under the terms of the GNU General Public License version 2 as |
| 6 | * published by the Free Software Foundation. |
| 7 | */ |
Nicolas Pitre | 33656d5 | 2014-06-02 17:32:25 +0100 | [diff] [blame] | 8 | |
| 9 | #ifdef CONFIG_CPU_ENDIAN_BE8 |
| 10 | #define ZIMAGE_MAGIC(x) ( (((x) >> 24) & 0x000000ff) | \ |
| 11 | (((x) >> 8) & 0x0000ff00) | \ |
| 12 | (((x) << 8) & 0x00ff0000) | \ |
| 13 | (((x) << 24) & 0xff000000) ) |
| 14 | #else |
| 15 | #define ZIMAGE_MAGIC(x) (x) |
| 16 | #endif |
| 17 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 18 | OUTPUT_ARCH(arm) |
| 19 | ENTRY(_start) |
| 20 | SECTIONS |
| 21 | { |
Catalin Marinas | bff595c | 2009-02-16 11:41:36 +0100 | [diff] [blame] | 22 | /DISCARD/ : { |
| 23 | *(.ARM.exidx*) |
| 24 | *(.ARM.extab*) |
Russell King | 5de813b | 2010-02-25 12:14:40 +0000 | [diff] [blame] | 25 | /* |
| 26 | * Discard any r/w data - this produces a link error if we have any, |
| 27 | * which is required for PIC decompression. Local data generates |
| 28 | * GOTOFF relocations, which prevents it being relocated independently |
| 29 | * of the text/got segments. |
| 30 | */ |
| 31 | *(.data) |
Catalin Marinas | bff595c | 2009-02-16 11:41:36 +0100 | [diff] [blame] | 32 | } |
| 33 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 34 | . = TEXT_START; |
| 35 | _text = .; |
| 36 | |
| 37 | .text : { |
| 38 | _start = .; |
| 39 | *(.start) |
| 40 | *(.text) |
Russell King | c5b8ef6 | 2006-04-09 19:08:42 +0100 | [diff] [blame] | 41 | *(.text.*) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 42 | *(.fixup) |
| 43 | *(.gnu.warning) |
Russell King | 3002b41 | 2011-05-26 11:40:54 +0100 | [diff] [blame] | 44 | *(.glue_7t) |
| 45 | *(.glue_7) |
| 46 | } |
| 47 | .rodata : { |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 48 | *(.rodata) |
| 49 | *(.rodata.*) |
Russell King | 3002b41 | 2011-05-26 11:40:54 +0100 | [diff] [blame] | 50 | } |
| 51 | .piggydata : { |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 52 | *(.piggydata) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 53 | } |
| 54 | |
Russell King | 3002b41 | 2011-05-26 11:40:54 +0100 | [diff] [blame] | 55 | . = ALIGN(4); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 56 | _etext = .; |
| 57 | |
Russell King | 3002b41 | 2011-05-26 11:40:54 +0100 | [diff] [blame] | 58 | .got.plt : { *(.got.plt) } |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 59 | _got_start = .; |
| 60 | .got : { *(.got) } |
| 61 | _got_end = .; |
Nicolas Pitre | 72bf0bc | 2011-05-27 22:25:26 -0400 | [diff] [blame] | 62 | |
| 63 | /* ensure the zImage file size is always a multiple of 64 bits */ |
| 64 | /* (without a dummy byte, ld just ignores the empty section) */ |
| 65 | .pad : { BYTE(0); . = ALIGN(8); } |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 66 | _edata = .; |
| 67 | |
Nicolas Pitre | 33656d5 | 2014-06-02 17:32:25 +0100 | [diff] [blame] | 68 | _magic_sig = ZIMAGE_MAGIC(0x016f2818); |
| 69 | _magic_start = ZIMAGE_MAGIC(_start); |
| 70 | _magic_end = ZIMAGE_MAGIC(_edata); |
| 71 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 72 | . = BSS_START; |
| 73 | __bss_start = .; |
| 74 | .bss : { *(.bss) } |
| 75 | _end = .; |
| 76 | |
Nicolas Pitre | 3bd2cbb | 2011-04-21 21:45:08 -0400 | [diff] [blame] | 77 | . = ALIGN(8); /* the stack must be 64-bit aligned */ |
Russell King | b0c4d4e | 2010-11-22 12:00:59 +0000 | [diff] [blame] | 78 | .stack : { *(.stack) } |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 79 | |
| 80 | .stab 0 : { *(.stab) } |
| 81 | .stabstr 0 : { *(.stabstr) } |
| 82 | .stab.excl 0 : { *(.stab.excl) } |
| 83 | .stab.exclstr 0 : { *(.stab.exclstr) } |
| 84 | .stab.index 0 : { *(.stab.index) } |
| 85 | .stab.indexstr 0 : { *(.stab.indexstr) } |
| 86 | .comment 0 : { *(.comment) } |
| 87 | } |