Wu Zhangjin | d4d9a55 | 2009-12-10 22:55:13 +0800 | [diff] [blame] | 1 | /* |
2 | * ld.script for compressed kernel support of MIPS | ||||
3 | * | ||||
4 | * Copyright (C) 2009 Lemote Inc. | ||||
Wu Zhangjin | bdbffd9 | 2010-06-16 15:52:19 +0800 | [diff] [blame] | 5 | * Author: Wu Zhangjin <wuzhanjing@gmail.com> |
6 | * Copyright (C) 2010 "Wu Zhangjin" <wuzhanjing@gmail.com> | ||||
Wu Zhangjin | d4d9a55 | 2009-12-10 22:55:13 +0800 | [diff] [blame] | 7 | */ |
8 | |||||
Wu Zhangjin | 1b93b3c | 2009-10-14 18:12:16 +0800 | [diff] [blame] | 9 | OUTPUT_ARCH(mips) |
10 | ENTRY(start) | ||||
Florian Fainelli | e970a72 | 2013-09-12 15:42:05 +0100 | [diff] [blame] | 11 | PHDRS { |
12 | text PT_LOAD FLAGS(7); /* RWX */ | ||||
13 | } | ||||
Wu Zhangjin | 1b93b3c | 2009-10-14 18:12:16 +0800 | [diff] [blame] | 14 | SECTIONS |
15 | { | ||||
Wu Zhangjin | bdbffd9 | 2010-06-16 15:52:19 +0800 | [diff] [blame] | 16 | /* Text and read-only data */ |
17 | /* . = VMLINUZ_LOAD_ADDRESS; */ | ||||
18 | .text : { | ||||
Wu Zhangjin | d4d9a55 | 2009-12-10 22:55:13 +0800 | [diff] [blame] | 19 | *(.text) |
20 | *(.rodata) | ||||
Florian Fainelli | e970a72 | 2013-09-12 15:42:05 +0100 | [diff] [blame] | 21 | }: text |
Wu Zhangjin | bdbffd9 | 2010-06-16 15:52:19 +0800 | [diff] [blame] | 22 | /* End of text section */ |
Wu Zhangjin | 1b93b3c | 2009-10-14 18:12:16 +0800 | [diff] [blame] | 23 | |
Wu Zhangjin | bdbffd9 | 2010-06-16 15:52:19 +0800 | [diff] [blame] | 24 | /* Writable data */ |
25 | .data : { | ||||
Wu Zhangjin | d4d9a55 | 2009-12-10 22:55:13 +0800 | [diff] [blame] | 26 | *(.data) |
Wu Zhangjin | bdbffd9 | 2010-06-16 15:52:19 +0800 | [diff] [blame] | 27 | /* Put the compressed image here */ |
Wu Zhangjin | d4d9a55 | 2009-12-10 22:55:13 +0800 | [diff] [blame] | 28 | __image_begin = .; |
29 | *(.image) | ||||
30 | __image_end = .; | ||||
31 | CONSTRUCTORS | ||||
32 | } | ||||
Wu Zhangjin | bdbffd9 | 2010-06-16 15:52:19 +0800 | [diff] [blame] | 33 | . = ALIGN(16); |
34 | _edata = .; | ||||
35 | /* End of data section */ | ||||
Wu Zhangjin | 1b93b3c | 2009-10-14 18:12:16 +0800 | [diff] [blame] | 36 | |
Wu Zhangjin | d4d9a55 | 2009-12-10 22:55:13 +0800 | [diff] [blame] | 37 | /* BSS */ |
Wu Zhangjin | bdbffd9 | 2010-06-16 15:52:19 +0800 | [diff] [blame] | 38 | .bss : { |
Wu Zhangjin | d4d9a55 | 2009-12-10 22:55:13 +0800 | [diff] [blame] | 39 | *(.bss) |
Wu Zhangjin | d4d9a55 | 2009-12-10 22:55:13 +0800 | [diff] [blame] | 40 | } |
Wu Zhangjin | bdbffd9 | 2010-06-16 15:52:19 +0800 | [diff] [blame] | 41 | . = ALIGN(16); |
42 | _end = .; | ||||
Wu Zhangjin | 1b93b3c | 2009-10-14 18:12:16 +0800 | [diff] [blame] | 43 | |
Wu Zhangjin | d4d9a55 | 2009-12-10 22:55:13 +0800 | [diff] [blame] | 44 | /* Sections to be discarded */ |
Wu Zhangjin | bdbffd9 | 2010-06-16 15:52:19 +0800 | [diff] [blame] | 45 | /DISCARD/ : { |
Wu Zhangjin | d4d9a55 | 2009-12-10 22:55:13 +0800 | [diff] [blame] | 46 | *(.MIPS.options) |
47 | *(.options) | ||||
48 | *(.pdr) | ||||
49 | *(.reginfo) | ||||
50 | *(.comment) | ||||
51 | *(.note) | ||||
52 | } | ||||
Wu Zhangjin | 1b93b3c | 2009-10-14 18:12:16 +0800 | [diff] [blame] | 53 | } |