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