aboutsummaryrefslogtreecommitdiff
path: root/usr.sbin/link.ld
blob: da2346dfa81cd7174d2138add5df29cb9acf39ba (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
ENTRY(_start)

PHDRS
{
    text          PT_LOAD    FLAGS((1 << 0) | (1 << 2)) ; /* Execute + Read */
    rodata        PT_LOAD    FLAGS((1 << 2)) ;            /* Read only */
    data          PT_LOAD    FLAGS((1 << 1) | (1 << 2)) ; /* Write + Read */
}

SECTIONS
{
    . = 0x10000;

    .text : {
        *(.text)
        *(.text.*)
    } :text

    .rodata : ALIGN(8) {
        *(.rodata)
        *(.rodata.*)
    } :rodata

    .data : ALIGN(8) {
        *(.data)
        *(.data.*)
    } :data

    .bss : ALIGN(8) {
        __bss_start = .;
        *(.bss)
        *(.bss.*)
        __bss_end = .;
    } :data
}