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