xref: /openbmc/qemu/linux-user/ppc/vdso-64.ld (revision 75d0e6b5)
1/*
2 * Linker script for linux powerpc64 replacement vdso.
3 *
4 * Copyright 2023 Linaro, Ltd.
5 *
6 * SPDX-License-Identifier: GPL-2.0-or-later
7 */
8
9VERSION {
10        LINUX_2.6.15 {
11        global:
12                __kernel_gettimeofday;
13                __kernel_clock_gettime;
14                __kernel_clock_getres;
15                __kernel_sync_dicache;
16                __kernel_sigtramp_rt64;
17                __kernel_getcpu;
18                __kernel_time;
19        local: *;
20        };
21}
22
23PHDRS {
24        phdr            PT_PHDR         FLAGS(4) PHDRS;
25        load            PT_LOAD         FLAGS(7) FILEHDR PHDRS; /* FLAGS=RWX */
26        dynamic         PT_DYNAMIC      FLAGS(4);
27        eh_frame_hdr    PT_GNU_EH_FRAME;
28        note            PT_NOTE         FLAGS(4);
29}
30
31SECTIONS {
32        . = SIZEOF_HEADERS;
33
34        /*
35         * The following, including the FILEHDRS and PHDRS, are modified
36         * when we relocate the binary.  We want them to be initially
37         * writable for the relocation; we'll force them read-only after.
38         */
39        .note           : { *(.note*) }         :load :note
40        .dynamic        : { *(.dynamic) }       :load :dynamic
41        .dynsym         : { *(.dynsym) }        :load
42        .data           : {
43                /*
44                 * There ought not be any real read-write data.
45                 * But since we manipulated the segment layout,
46                 * we have to put these sections somewhere.
47                 */
48                *(.data*)
49                *(.sdata*)
50                *(.got.plt) *(.got)
51                *(.gnu.linkonce.d.*)
52                *(.bss*)
53                *(.dynbss*)
54                *(.gnu.linkonce.b.*)
55        }
56
57        .rodata         : { *(.rodata*) }
58        .hash           : { *(.hash) }
59        .gnu.hash       : { *(.gnu.hash) }
60        .dynstr         : { *(.dynstr) }
61        .gnu.version    : { *(.gnu.version) }
62        .gnu.version_d  : { *(.gnu.version_d) }
63        .gnu.version_r  : { *(.gnu.version_r) }
64        .eh_frame_hdr   : { *(.eh_frame_hdr) }  :load :eh_frame_hdr
65        .eh_frame       : { *(.eh_frame) }      :load
66
67        .text           : { *(.text*) }         :load
68}
69