xref: /openbsd/libexec/ld.so/powerpc/ld.script (revision 805b87ea)
1c0197e40SguentherPHDRS
2c0197e40Sguenther{
3c0197e40Sguenther	rodata	PT_LOAD FILEHDR PHDRS FLAGS (4);
4e201c79bSderaadt	btext	PT_LOAD FLAGS (0x08000005);
5*805b87eaSderaadt	text	PT_LOAD FLAGS (1);
6c0197e40Sguenther	data	PT_LOAD;
7c0197e40Sguenther	random	PT_OPENBSD_RANDOMIZE;
883762a71Sderaadt	syscalls PT_OPENBSD_SYSCALLS;
9c0197e40Sguenther	relro	PT_GNU_RELRO;
10c0197e40Sguenther	dynamic	PT_DYNAMIC;
11c0197e40Sguenther	note	PT_NOTE;
12c0197e40Sguenther}
13c0197e40Sguenther
14c0197e40SguentherSECTIONS
15c0197e40Sguenther{
16c0197e40Sguenther    . = 0 + SIZEOF_HEADERS;
17c0197e40Sguenther    /* RODATA */
18c0197e40Sguenther    .dynsym	: { *(.dynsym) } :rodata
19c0197e40Sguenther    .gnu.hash	: { *(.gnu.hash) } :rodata
20c0197e40Sguenther    .dynstr	: { *(.dynstr) } :rodata
21c0197e40Sguenther    .rodata	: { *(.rodata .rodata.*) } :rodata
22c0197e40Sguenther    .eh_frame	: { *(.eh_frame) } :rodata
23c0197e40Sguenther
24c0197e40Sguenther    /* TEXT */
25c0197e40Sguenther    . = ALIGN(0x10000);
26c0197e40Sguenther    .boot.text	:
27c0197e40Sguenther    {
28e201c79bSderaadt	. = ALIGN(0x1000);
29c0197e40Sguenther	boot_text_start = .;
30c0197e40Sguenther	*(.boot.text)
31e201c79bSderaadt	. = ALIGN(0x1000);
32c0197e40Sguenther	boot_text_end = .;
33e201c79bSderaadt    } :btext
34c0197e40Sguenther    . = ALIGN(0x1000);
35c0197e40Sguenther    .text	: { *(.text .text.*) } :text
36c0197e40Sguenther
37c0197e40Sguenther    /* RELRO DATA */
38c0197e40Sguenther    . = DATA_SEGMENT_ALIGN (0x10000, 0x1000);
39c0197e40Sguenther    .openbsd.randomdata :
40c0197e40Sguenther    {
41c0197e40Sguenther	*(.openbsd.randomdata .openbsd.randomdata.*)
42c0197e40Sguenther    } :data :relro :random
4383762a71Sderaadt    .openbsd.syscalls :
4483762a71Sderaadt    {
4583762a71Sderaadt	*(.openbsd.syscalls .openbsd.syscalls.*)
4683762a71Sderaadt    } :syscalls
4783762a71Sderaadt
48c0197e40Sguenther    .data.rel.ro : { *(.data.rel.ro.local*) *(.data.rel.ro*) } :data :relro
49c0197e40Sguenther    .dynamic	: { *(.dynamic) } :data :relro :dynamic
50c0197e40Sguenther    .got	: { *(.got.plt) *(.got) } :data :relro
51c0197e40Sguenther    . = DATA_SEGMENT_RELRO_END (0, .);
52c0197e40Sguenther
53c0197e40Sguenther    /* BOOTDATA */
54c0197e40Sguenther    boot_data_start = .;
55c0197e40Sguenther    .rela.dyn	:
56c0197e40Sguenther    {
57c0197e40Sguenther	*(.rela.text .rela.text.*)
58c0197e40Sguenther	*(.rela.rodata .rela.rodata.*)
59c0197e40Sguenther	*(.rela.data .rela.data.*)
60c0197e40Sguenther	*(.rela.got)
61c0197e40Sguenther	*(.rela.bss .rela.bss.*)
62c0197e40Sguenther    } :data
63c0197e40Sguenther/* XXX .rela.plt is unused but cannot delete: ld.bfd zeros DT_RELASZ then! */
64c0197e40Sguenther    .rela.plt	: { *(.rela.plt) } :data
65c0197e40Sguenther    .hash	: { *(.hash) } :data
66c0197e40Sguenther    .note	: { *(.note.openbsd.*) } :data :note
67c0197e40Sguenther    .boot.data	: { *(.boot.data .boot.data.*) } :data
68c0197e40Sguenther    boot_data_end = .;
69c0197e40Sguenther
70c0197e40Sguenther    /* DATA */
71c0197e40Sguenther    . = ALIGN(0x1000);
72c0197e40Sguenther    .sdata	: { *(.sdata .sdata.*) } :data
73c0197e40Sguenther    .data	: { *(.data .data.*) } :data
74c0197e40Sguenther    .sbss	: { *(.sbss .sbss.*) } :data
75c0197e40Sguenther    .bss	: { *(.dynbss) *(.bss .bss.*) *(COMMON) } :data
76c0197e40Sguenther    . = DATA_SEGMENT_END (.);
77c0197e40Sguenther
78c0197e40Sguenther    /DISCARD/	: { *(.note.GNU-stack) }
79c0197e40Sguenther}
80