xref: /openbmc/qemu/linux-user/ppc/vdso-32.ld (revision 4921d0a7)
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_gettime64;
15                __kernel_clock_getres;
16                __kernel_time;
17                __kernel_sync_dicache;
18                __kernel_sigtramp32;
19                __kernel_sigtramp_rt32;
20                __kernel_getcpu;
21        local: *;
22        };
23}
24
25PHDRS {
26        phdr            PT_PHDR         FLAGS(4) PHDRS;
27        load            PT_LOAD         FLAGS(7) FILEHDR PHDRS; /* FLAGS=RWX */
28        dynamic         PT_DYNAMIC      FLAGS(4);
29        eh_frame_hdr    PT_GNU_EH_FRAME;
30        note            PT_NOTE         FLAGS(4);
31}
32
33SECTIONS {
34        . = SIZEOF_HEADERS;
35
36        /*
37         * The following, including the FILEHDRS and PHDRS, are modified
38         * when we relocate the binary.  We want them to be initially
39         * writable for the relocation; we'll force them read-only after.
40         */
41        .note           : { *(.note*) }         :load :note
42        .dynamic        : { *(.dynamic) }       :load :dynamic
43        .dynsym         : { *(.dynsym) }        :load
44        .data           : {
45                /*
46                 * There ought not be any real read-write data.
47                 * But since we manipulated the segment layout,
48                 * we have to put these sections somewhere.
49                 */
50                *(.data*)
51                *(.sdata*)
52                *(.got.plt) *(.got)
53                *(.gnu.linkonce.d.*)
54                *(.bss*)
55                *(.dynbss*)
56                *(.gnu.linkonce.b.*)
57        }
58
59        .rodata         : { *(.rodata*) }
60        .hash           : { *(.hash) }
61        .gnu.hash       : { *(.gnu.hash) }
62        .dynstr         : { *(.dynstr) }
63        .gnu.version    : { *(.gnu.version) }
64        .gnu.version_d  : { *(.gnu.version_d) }
65        .gnu.version_r  : { *(.gnu.version_r) }
66        .eh_frame_hdr   : { *(.eh_frame_hdr) }  :load :eh_frame_hdr
67        .eh_frame       : { *(.eh_frame) }      :load
68
69        .text           : { *(.text*) }         :load
70}
71