summaryrefslogtreecommitdiff
path: root/libexec/ld.so/alpha/ld.script
blob: dd642a29f0cf5e9db3af929e64627173564857bd (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
PHDRS
{
	rodata	PT_LOAD FILEHDR PHDRS FLAGS (4);
	text	PT_LOAD FLAGS (1);
	btext	PT_LOAD FLAGS (0x08000005);
	data	PT_LOAD;
	random	PT_OPENBSD_RANDOMIZE;
	syscalls PT_OPENBSD_SYSCALLS;
	relro	PT_GNU_RELRO;
	dynamic	PT_DYNAMIC;
	note	PT_NOTE;
}

SECTIONS
{
    /* RODATA */
    . = 0 + SIZEOF_HEADERS;
    .dynsym	: { *(.dynsym) } :rodata
    .gnu.hash	: { *(.gnu.hash) } :rodata
    .dynstr	: { *(.dynstr) } :rodata
    .rodata	: { *(.rodata .rodata.*) } :rodata
    .eh_frame	: { *(.eh_frame) } :rodata

    /* TEXT */
    . = ALIGN(0x10000);
    .boot.text	:
    {
	. = ALIGN(0x2000);
	boot_text_start = .;
	. = ALIGN(0x2000);
	*(.boot.text)
	boot_text_end = .;
    } :btext
    . = ALIGN(0x2000);
    .text	: { *(.text .text.*) } :text

    /* RELRO DATA */
    . = DATA_SEGMENT_ALIGN (0x10000, 0x2000);
    .openbsd.randomdata :
    {
	*(.openbsd.randomdata .openbsd.randomdata.*)
    } :data :relro :random
    .openbsd.syscalls :
    {
	*(.openbsd.syscalls .openbsd.syscalls.*)
    } :syscalls
    .data.rel.ro : { *(.data.rel.ro.local*) *(.data.rel.ro*) } :data :relro
    .dynamic	: { *(.dynamic) } :data :relro :dynamic
    .got	: { *(.got.plt) *(.got) } :data :relro
    . = DATA_SEGMENT_RELRO_END (0, .);

    /* BOOTDATA */
    . = ALIGN(0x2000);
    boot_data_start = .;
    .rela.dyn	:
    {
	*(.rela.text .rela.text.*)
	*(.rela.rodata .rela.rodata.*)
	*(.rela.data .rela.data.*)
	*(.rela.got)
	*(.rela.bss .rela.bss.*)
    } :data
/* XXX .rela.plt is unused but cannot delete: ld.bfd zeros DT_RELASZ then! */
    .rela.plt	: { *(.rela.plt) } :data
    .hash	: { *(.hash) } :data
    .note	: { *(.note.openbsd.*) } :data :note
    .boot.data	: { *(.boot.data .boot.data.*) } :data
    boot_data_end = .;

    /* DATA */
    . = ALIGN(0x2000);
    .data	: { *(.data .data.*) } :data
    .bss	: { *(.dynbss) *(.bss .bss.*) *(COMMON) } :data
    . = DATA_SEGMENT_END (.);

    /DISCARD/	: { *(.note.GNU-stack) }
}