1/*
2 * This is the infamous ld script for the 64 bits vdso
3 * library
4 */
5#include <asm/vdso.h>
6
7#ifdef __LITTLE_ENDIAN__
8OUTPUT_FORMAT("elf64-powerpcle", "elf64-powerpcle", "elf64-powerpcle")
9#else
10OUTPUT_FORMAT("elf64-powerpc", "elf64-powerpc", "elf64-powerpc")
11#endif
12OUTPUT_ARCH(powerpc:common64)
13ENTRY(_start)
14
15SECTIONS
16{
17	. = VDSO64_LBASE + SIZEOF_HEADERS;
18
19	.hash		: { *(.hash) }			:text
20	.gnu.hash	: { *(.gnu.hash) }
21	.dynsym		: { *(.dynsym) }
22	.dynstr		: { *(.dynstr) }
23	.gnu.version	: { *(.gnu.version) }
24	.gnu.version_d	: { *(.gnu.version_d) }
25	.gnu.version_r	: { *(.gnu.version_r) }
26
27	.note		: { *(.note.*) }		:text	:note
28
29	. = ALIGN(16);
30	.text		: {
31		*(.text .stub .text.* .gnu.linkonce.t.* __ftr_alt_*)
32		*(.sfpr .glink)
33	}						:text
34	PROVIDE(__etext = .);
35	PROVIDE(_etext = .);
36	PROVIDE(etext = .);
37
38	. = ALIGN(8);
39	__ftr_fixup	: { *(__ftr_fixup) }
40
41	. = ALIGN(8);
42	__mmu_ftr_fixup	: { *(__mmu_ftr_fixup) }
43
44	. = ALIGN(8);
45	__lwsync_fixup	: { *(__lwsync_fixup) }
46
47	. = ALIGN(8);
48	__fw_ftr_fixup	: { *(__fw_ftr_fixup) }
49
50	/*
51	 * Other stuff is appended to the text segment:
52	 */
53	.rodata		: { *(.rodata .rodata.* .gnu.linkonce.r.*) }
54	.rodata1	: { *(.rodata1) }
55
56	.dynamic	: { *(.dynamic) }		:text	:dynamic
57
58	.eh_frame_hdr	: { *(.eh_frame_hdr) }		:text	:eh_frame_hdr
59	.eh_frame	: { KEEP (*(.eh_frame)) }	:text
60	.gcc_except_table : { *(.gcc_except_table) }
61	.rela.dyn ALIGN(8) : { *(.rela.dyn) }
62
63	.opd ALIGN(8)	: { KEEP (*(.opd)) }
64	.got ALIGN(8)	: { *(.got .toc) }
65
66	_end = .;
67	PROVIDE(end = .);
68
69	/*
70	 * Stabs debugging sections are here too.
71	 */
72	.stab          0 : { *(.stab) }
73	.stabstr       0 : { *(.stabstr) }
74	.stab.excl     0 : { *(.stab.excl) }
75	.stab.exclstr  0 : { *(.stab.exclstr) }
76	.stab.index    0 : { *(.stab.index) }
77	.stab.indexstr 0 : { *(.stab.indexstr) }
78	.comment       0 : { *(.comment) }
79
80	/*
81	 * DWARF debug sections.
82	 * Symbols in the DWARF debugging sections are relative to the beginning
83	 * of the section so we begin them at 0.
84	 */
85	/* DWARF 1 */
86	.debug          0 : { *(.debug) }
87	.line           0 : { *(.line) }
88	/* GNU DWARF 1 extensions */
89	.debug_srcinfo  0 : { *(.debug_srcinfo) }
90	.debug_sfnames  0 : { *(.debug_sfnames) }
91	/* DWARF 1.1 and DWARF 2 */
92	.debug_aranges  0 : { *(.debug_aranges) }
93	.debug_pubnames 0 : { *(.debug_pubnames) }
94	/* DWARF 2 */
95	.debug_info     0 : { *(.debug_info .gnu.linkonce.wi.*) }
96	.debug_abbrev   0 : { *(.debug_abbrev) }
97	.debug_line     0 : { *(.debug_line) }
98	.debug_frame    0 : { *(.debug_frame) }
99	.debug_str      0 : { *(.debug_str) }
100	.debug_loc      0 : { *(.debug_loc) }
101	.debug_macinfo  0 : { *(.debug_macinfo) }
102	/* SGI/MIPS DWARF 2 extensions */
103	.debug_weaknames 0 : { *(.debug_weaknames) }
104	.debug_funcnames 0 : { *(.debug_funcnames) }
105	.debug_typenames 0 : { *(.debug_typenames) }
106	.debug_varnames  0 : { *(.debug_varnames) }
107
108	/DISCARD/	: {
109		*(.note.GNU-stack)
110		*(.branch_lt)
111		*(.data .data.* .gnu.linkonce.d.* .sdata*)
112		*(.bss .sbss .dynbss .dynsbss)
113	}
114}
115
116/*
117 * Very old versions of ld do not recognize this name token; use the constant.
118 */
119#define PT_GNU_EH_FRAME	0x6474e550
120
121/*
122 * We must supply the ELF program headers explicitly to get just one
123 * PT_LOAD segment, and set the flags explicitly to make segments read-only.
124 */
125PHDRS
126{
127	text		PT_LOAD FILEHDR PHDRS FLAGS(5);	/* PF_R|PF_X */
128	dynamic		PT_DYNAMIC FLAGS(4);		/* PF_R */
129	note		PT_NOTE FLAGS(4);		/* PF_R */
130	eh_frame_hdr	PT_GNU_EH_FRAME;
131}
132
133/*
134 * This controls what symbols we export from the DSO.
135 */
136VERSION
137{
138	VDSO_VERSION_STRING {
139	global:
140		/*
141		 * Has to be there for the kernel to find
142		 */
143		__kernel_datapage_offset;
144
145		__kernel_get_syscall_map;
146		__kernel_gettimeofday;
147		__kernel_clock_gettime;
148		__kernel_clock_getres;
149		__kernel_get_tbfreq;
150		__kernel_sync_dicache;
151		__kernel_sync_dicache_p5;
152		__kernel_sigtramp_rt64;
153		__kernel_getcpu;
154		__kernel_time;
155
156	local: *;
157	};
158}
159