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 | ||||
Jonas Gorski | c0b4e10 | 2015-04-12 12:24:59 +0200 | [diff] [blame] | 32 | . = ALIGN(16); |
Wu Zhangjin | d4d9a55 | 2009-12-10 22:55:13 +0800 | [diff] [blame] | 33 | } |
Jonas Gorski | c0b4e10 | 2015-04-12 12:24:59 +0200 | [diff] [blame] | 34 | __appended_dtb = .; |
35 | /* leave space for appended DTB */ | ||||
36 | . += 0x100000; | ||||
37 | |||||
Wu Zhangjin | bdbffd9 | 2010-06-16 15:52:19 +0800 | [diff] [blame] | 38 | _edata = .; |
39 | /* End of data section */ | ||||
Wu Zhangjin | 1b93b3c | 2009-10-14 18:12:16 +0800 | [diff] [blame] | 40 | |
Wu Zhangjin | d4d9a55 | 2009-12-10 22:55:13 +0800 | [diff] [blame] | 41 | /* BSS */ |
Wu Zhangjin | bdbffd9 | 2010-06-16 15:52:19 +0800 | [diff] [blame] | 42 | .bss : { |
Wu Zhangjin | d4d9a55 | 2009-12-10 22:55:13 +0800 | [diff] [blame] | 43 | *(.bss) |
Wu Zhangjin | d4d9a55 | 2009-12-10 22:55:13 +0800 | [diff] [blame] | 44 | } |
Wu Zhangjin | bdbffd9 | 2010-06-16 15:52:19 +0800 | [diff] [blame] | 45 | . = ALIGN(16); |
46 | _end = .; | ||||
Wu Zhangjin | 1b93b3c | 2009-10-14 18:12:16 +0800 | [diff] [blame] | 47 | |
Wu Zhangjin | d4d9a55 | 2009-12-10 22:55:13 +0800 | [diff] [blame] | 48 | /* Sections to be discarded */ |
Wu Zhangjin | bdbffd9 | 2010-06-16 15:52:19 +0800 | [diff] [blame] | 49 | /DISCARD/ : { |
Wu Zhangjin | d4d9a55 | 2009-12-10 22:55:13 +0800 | [diff] [blame] | 50 | *(.MIPS.options) |
51 | *(.options) | ||||
52 | *(.pdr) | ||||
53 | *(.reginfo) | ||||
54 | *(.comment) | ||||
55 | *(.note) | ||||
56 | } | ||||
Wu Zhangjin | 1b93b3c | 2009-10-14 18:12:16 +0800 | [diff] [blame] | 57 | } |