xref: /openbsd/libexec/ld.so/sh/ld.script (revision 510d2225)
1PHDRS
2{
3	rodata	PT_LOAD FILEHDR PHDRS FLAGS (4);
4	text	PT_LOAD FLAGS (5);  /* architecturally required data islands */
5	btext	PT_LOAD FLAGS (0x08000005);
6	data	PT_LOAD;
7	random	PT_OPENBSD_RANDOMIZE;
8	syscalls PT_OPENBSD_SYSCALLS;
9	relro	PT_GNU_RELRO;
10	dynamic	PT_DYNAMIC;
11	note	PT_NOTE;
12}
13
14SECTIONS
15{
16  /* RODATA */
17  . = 0 + SIZEOF_HEADERS;
18  .gnu.hash       : { *(.gnu.hash) } :rodata
19  .dynsym         : { *(.dynsym) } :rodata
20  .dynstr         : { *(.dynstr) } :rodata
21  .rodata         : { *(.rodata .rodata.*) } :rodata
22  .eh_frame       : { *(.eh_frame) } :rodata
23
24  /* TEXT */
25  . = ALIGN (0x1000);
26  .text           : { *(.text .text.*) } :text =0xc3c3c3c3
27  . = ALIGN (0x1000);
28  .boot.text      :
29  {
30    boot_text_start = .;
31    *(.boot.text)
32    boot_text_end = .;
33  } :btext
34
35  /* RELRO DATA */
36  . = DATA_SEGMENT_ALIGN (0x10000, 0x1000);
37  .openbsd.randomdata     : { *(.openbsd.randomdata .openbsd.randomdata.*) }
38    :data :relro :random
39  .openbsd.syscalls : { *(.openbsd.syscalls .openbsd.syscalls.*) } :syscalls
40  .data.rel.ro : { *(.data.rel.ro.local*) *(.data.rel.ro*) } :data :relro
41  .dynamic        : { *(.dynamic) } :data :relro :dynamic
42  .got            : { *(.got.plt) *(.got) } :data :relro
43  . = DATA_SEGMENT_RELRO_END (0, .);
44
45  /* BOOTDATA */
46  . = ALIGN (0x1000);
47  boot_data_start = .;
48  .rela.dyn       :
49    {
50      *(.rela.text .rela.text.*)
51      *(.rela.rodata .rela.rodata.*)
52      *(.rela.data .rela.data.*)
53      *(.rela.got)
54      *(.rela.bss .rela.bss.*)
55    } :data
56  .rela.plt       : { *(.rela.plt) } :data
57  .hash           : { *(.hash) } :data
58  .note           : { *(.note.openbsd.* ) } :data :note
59  .boot.data      : { *(.boot.data .boot.data.*) } :data
60  boot_data_end = .;
61
62  /* DATA */
63  . = ALIGN (0x1000);
64  .data           : { *(.data .data.*) } :data
65  .bss            : { *(.dynbss) *(.bss .bss.*) *(COMMON) } :data
66  . = DATA_SEGMENT_END (.);
67}
68