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