blob: 5a33409c7f63b09bf7599ed77a4dd762c99f8ead [file] [log] [blame]
Wu Zhangjind4d9a552009-12-10 22:55:13 +08001/*
2 * ld.script for compressed kernel support of MIPS
3 *
4 * Copyright (C) 2009 Lemote Inc.
Wu Zhangjinbdbffd92010-06-16 15:52:19 +08005 * Author: Wu Zhangjin <wuzhanjing@gmail.com>
6 * Copyright (C) 2010 "Wu Zhangjin" <wuzhanjing@gmail.com>
Wu Zhangjind4d9a552009-12-10 22:55:13 +08007 */
8
Wu Zhangjin1b93b3c2009-10-14 18:12:16 +08009OUTPUT_ARCH(mips)
10ENTRY(start)
Florian Fainellie970a722013-09-12 15:42:05 +010011PHDRS {
12 text PT_LOAD FLAGS(7); /* RWX */
13}
Wu Zhangjin1b93b3c2009-10-14 18:12:16 +080014SECTIONS
15{
Wu Zhangjinbdbffd92010-06-16 15:52:19 +080016 /* Text and read-only data */
17 /* . = VMLINUZ_LOAD_ADDRESS; */
18 .text : {
Wu Zhangjind4d9a552009-12-10 22:55:13 +080019 *(.text)
20 *(.rodata)
Florian Fainellie970a722013-09-12 15:42:05 +010021 }: text
Wu Zhangjinbdbffd92010-06-16 15:52:19 +080022 /* End of text section */
Wu Zhangjin1b93b3c2009-10-14 18:12:16 +080023
Wu Zhangjinbdbffd92010-06-16 15:52:19 +080024 /* Writable data */
25 .data : {
Wu Zhangjind4d9a552009-12-10 22:55:13 +080026 *(.data)
Wu Zhangjinbdbffd92010-06-16 15:52:19 +080027 /* Put the compressed image here */
Wu Zhangjind4d9a552009-12-10 22:55:13 +080028 __image_begin = .;
29 *(.image)
30 __image_end = .;
31 CONSTRUCTORS
32 }
Wu Zhangjinbdbffd92010-06-16 15:52:19 +080033 . = ALIGN(16);
34 _edata = .;
35 /* End of data section */
Wu Zhangjin1b93b3c2009-10-14 18:12:16 +080036
Wu Zhangjind4d9a552009-12-10 22:55:13 +080037 /* BSS */
Wu Zhangjinbdbffd92010-06-16 15:52:19 +080038 .bss : {
Wu Zhangjind4d9a552009-12-10 22:55:13 +080039 *(.bss)
Wu Zhangjind4d9a552009-12-10 22:55:13 +080040 }
Wu Zhangjinbdbffd92010-06-16 15:52:19 +080041 . = ALIGN(16);
42 _end = .;
Wu Zhangjin1b93b3c2009-10-14 18:12:16 +080043
Wu Zhangjind4d9a552009-12-10 22:55:13 +080044 /* Sections to be discarded */
Wu Zhangjinbdbffd92010-06-16 15:52:19 +080045 /DISCARD/ : {
Wu Zhangjind4d9a552009-12-10 22:55:13 +080046 *(.MIPS.options)
47 *(.options)
48 *(.pdr)
49 *(.reginfo)
50 *(.comment)
51 *(.note)
52 }
Wu Zhangjin1b93b3c2009-10-14 18:12:16 +080053}