xref: /linux/arch/mips/boot/compressed/ld.script (revision cdd38c5f1ce4398ec58fec95904b75824daab7b5)
1d4d9a553SWu Zhangjin/*
2d4d9a553SWu Zhangjin * ld.script for compressed kernel support of MIPS
3d4d9a553SWu Zhangjin *
4d4d9a553SWu Zhangjin * Copyright (C) 2009 Lemote Inc.
5bdbffd9bSWu Zhangjin * Author: Wu Zhangjin <wuzhanjing@gmail.com>
6bdbffd9bSWu Zhangjin * Copyright (C) 2010 "Wu Zhangjin" <wuzhanjing@gmail.com>
7d4d9a553SWu Zhangjin */
8d4d9a553SWu Zhangjin
91b93b3c3SWu ZhangjinOUTPUT_ARCH(mips)
101b93b3c3SWu ZhangjinENTRY(start)
11e970a72eSFlorian FainelliPHDRS {
12e970a72eSFlorian Fainelli	text PT_LOAD FLAGS(7); /* RWX */
13e970a72eSFlorian Fainelli}
141b93b3c3SWu ZhangjinSECTIONS
151b93b3c3SWu Zhangjin{
16bdbffd9bSWu Zhangjin	/* Text and read-only data */
17bdbffd9bSWu Zhangjin	/* . = VMLINUZ_LOAD_ADDRESS; */
18d4d9a553SWu Zhangjin	.text : {
191b93b3c3SWu Zhangjin		*(.text)
201b93b3c3SWu Zhangjin		*(.rodata)
21e970a72eSFlorian Fainelli	}: text
22bdbffd9bSWu Zhangjin	/* End of text section */
231b93b3c3SWu Zhangjin
24bdbffd9bSWu Zhangjin	/* Writable data */
25bdbffd9bSWu Zhangjin	.data : {
261b93b3c3SWu Zhangjin		*(.data)
27bdbffd9bSWu Zhangjin		/* Put the compressed image here */
281b93b3c3SWu Zhangjin		__image_begin = .;
291b93b3c3SWu Zhangjin		*(.image)
301b93b3c3SWu Zhangjin		__image_end = .;
311b93b3c3SWu Zhangjin		CONSTRUCTORS
32bdbffd9bSWu Zhangjin		. = ALIGN(16);
33c0b4e101SJonas Gorski	}
34*d2e850e9SChuanhong Guo
35*d2e850e9SChuanhong Guo	.appended_dtb : {
36c0b4e101SJonas Gorski		__appended_dtb = .;
37c0b4e101SJonas Gorski		/* leave space for appended DTB */
38c0b4e101SJonas Gorski		. += 0x100000;
39*d2e850e9SChuanhong Guo	}
40c0b4e101SJonas Gorski
41bdbffd9bSWu Zhangjin	_edata = .;
42bdbffd9bSWu Zhangjin	/* End of data section */
431b93b3c3SWu Zhangjin
44d4d9a553SWu Zhangjin	/* BSS */
45d4d9a553SWu Zhangjin	.bss : {
461b93b3c3SWu Zhangjin		*(.bss)
47d4d9a553SWu Zhangjin	}
48bdbffd9bSWu Zhangjin	. = ALIGN(16);
491b93b3c3SWu Zhangjin	_end = .;
501b93b3c3SWu Zhangjin
51d4d9a553SWu Zhangjin	/* Sections to be discarded */
52d4d9a553SWu Zhangjin	/DISCARD/ : {
53d4d9a553SWu Zhangjin		*(.MIPS.options)
54d4d9a553SWu Zhangjin		*(.options)
55d4d9a553SWu Zhangjin		*(.pdr)
56d4d9a553SWu Zhangjin		*(.reginfo)
57d4d9a553SWu Zhangjin		*(.comment)
58d4d9a553SWu Zhangjin		*(.note)
59d4d9a553SWu Zhangjin	}
601b93b3c3SWu Zhangjin}
61