1OUTPUT_FORMAT("elf64-sparc")
2OUTPUT_ARCH(sparc:v9)
3
4ENTRY(_start)
5
6PHDRS
7{
8	/* have a non-loadable program chunk with the headers, then a loadable one
9	 * with the actual data. This eases the work of elf2aout. */
10	headers PT_NULL FILEHDR PHDRS ;
11	text PT_LOAD ;
12}
13
14SECTIONS
15{
16	/* Execution address. The file is loaded at 0x4000 with its header,
17	 * then relocated here. */
18	. = 0x202000;
19	__text_begin = .;
20
21	/* keep text and data sections next to each other, as the loader in openboot
22	 * is not able to handle a hole between them.
23	 */
24
25	/* text/read-only data */
26	.text :	{ 
27			  /* Make sure entry point is at start of file. Not required, since
28			   * it is set using ENTRY above, but it looks nicer and makes it
29			   * clearer we jumped at the correct address. */
30              *(.text.start)
31
32			  *(.text .text.* .gnu.linkonce.t.*)
33	          *(.rodata .rodata.* .gnu.linkonce.r.*)
34	          *(.sdata2) } :text
35
36	.data : {
37		__ctor_list = .;
38		*(.ctors)
39		__ctor_end = .;
40
41		__data_start = .;
42		*(.data .gnu.linkonce.d.*)
43		*(.data.rel.ro.local .data.rel.ro*)
44		*(.got .got2)
45		*(.sdata .sdata.* .gnu.linkonce.s.* .fixup) } :text
46
47	/* uninitialized data (in same segment as writable data) */
48	__bss_start = .;
49	.bss : { *(.sbss .sbss.* .gnu.linkonce.sb.*)
50
51		*(.bss .bss.* .gnu.linkonce.b.*)
52		. = ALIGN(0x1000);
53	} :text
54
55	_end = . ;
56
57	/* Strip unnecessary stuff */
58	/DISCARD/ : { *(.comment .note .eh_frame .dtors .debug_* .gnu.attributes) }
59}
60