blob: 613a35b02f50b8f372f4a701c2b589c134a0e5ed [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.
5 * Author: Wu Zhangjin <wuzj@lemote.com>
6 */
7
Wu Zhangjin1b93b3c2009-10-14 18:12:16 +08008OUTPUT_ARCH(mips)
9ENTRY(start)
10SECTIONS
11{
Wu Zhangjind4d9a552009-12-10 22:55:13 +080012 /* . = VMLINUZ_LOAD_ADDRESS */
13 /* read-only */
14 _text = .; /* Text and read-only data */
15 .text : {
16 _ftext = . ;
17 *(.text)
18 *(.rodata)
19 } = 0
20 _etext = .; /* End of text section */
Wu Zhangjin1b93b3c2009-10-14 18:12:16 +080021
Wu Zhangjind4d9a552009-12-10 22:55:13 +080022 /* writable */
23 .data : { /* Data */
24 _fdata = . ;
25 *(.data)
26 /* Put the compressed image here, so bss is on the end. */
27 __image_begin = .;
28 *(.image)
29 __image_end = .;
30 CONSTRUCTORS
31 }
32 .sdata : { *(.sdata) }
33 . = ALIGN(4);
34 _edata = .; /* End of data section */
Wu Zhangjin1b93b3c2009-10-14 18:12:16 +080035
Wu Zhangjind4d9a552009-12-10 22:55:13 +080036 /* BSS */
37 __bss_start = .;
38 _fbss = .;
39 .sbss : { *(.sbss) *(.scommon) }
40 .bss : {
41 *(.dynbss)
42 *(.bss)
43 *(COMMON)
44 }
45 . = ALIGN(4);
46 _end = . ;
Wu Zhangjin1b93b3c2009-10-14 18:12:16 +080047
Wu Zhangjind4d9a552009-12-10 22:55:13 +080048 /* These are needed for ELF backends which have not yet been converted
49 * to the new style linker. */
Wu Zhangjin1b93b3c2009-10-14 18:12:16 +080050
Wu Zhangjind4d9a552009-12-10 22:55:13 +080051 .stab 0 : { *(.stab) }
52 .stabstr 0 : { *(.stabstr) }
Wu Zhangjin1b93b3c2009-10-14 18:12:16 +080053
Wu Zhangjind4d9a552009-12-10 22:55:13 +080054 /* These must appear regardless of . */
55 .gptab.sdata : { *(.gptab.data) *(.gptab.sdata) }
56 .gptab.sbss : { *(.gptab.bss) *(.gptab.sbss) }
Wu Zhangjin1b93b3c2009-10-14 18:12:16 +080057
Wu Zhangjind4d9a552009-12-10 22:55:13 +080058 /* Sections to be discarded */
59 /DISCARD/ : {
60 *(.MIPS.options)
61 *(.options)
62 *(.pdr)
63 *(.reginfo)
64 *(.comment)
65 *(.note)
66 }
Wu Zhangjin1b93b3c2009-10-14 18:12:16 +080067}