blob: 2ed08fbef8e7505a022629a0e183a0c004a44ec6 [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
Jonas Gorskic0b4e102015-04-12 12:24:59 +020032 . = ALIGN(16);
Wu Zhangjind4d9a552009-12-10 22:55:13 +080033 }
Jonas Gorskic0b4e102015-04-12 12:24:59 +020034 __appended_dtb = .;
35 /* leave space for appended DTB */
36 . += 0x100000;
37
Wu Zhangjinbdbffd92010-06-16 15:52:19 +080038 _edata = .;
39 /* End of data section */
Wu Zhangjin1b93b3c2009-10-14 18:12:16 +080040
Wu Zhangjind4d9a552009-12-10 22:55:13 +080041 /* BSS */
Wu Zhangjinbdbffd92010-06-16 15:52:19 +080042 .bss : {
Wu Zhangjind4d9a552009-12-10 22:55:13 +080043 *(.bss)
Wu Zhangjind4d9a552009-12-10 22:55:13 +080044 }
Wu Zhangjinbdbffd92010-06-16 15:52:19 +080045 . = ALIGN(16);
46 _end = .;
Wu Zhangjin1b93b3c2009-10-14 18:12:16 +080047
Wu Zhangjind4d9a552009-12-10 22:55:13 +080048 /* Sections to be discarded */
Wu Zhangjinbdbffd92010-06-16 15:52:19 +080049 /DISCARD/ : {
Wu Zhangjind4d9a552009-12-10 22:55:13 +080050 *(.MIPS.options)
51 *(.options)
52 *(.pdr)
53 *(.reginfo)
54 *(.comment)
55 *(.note)
56 }
Wu Zhangjin1b93b3c2009-10-14 18:12:16 +080057}