xref: /qemu/linux-user/hppa/vdso.ld (revision 5db05230)
1/*
2 * Linker script for linux hppa vdso.
3 *
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Lesser General Public
6 * License as published by the Free Software Foundation; either
7 * version 2 of the License, or (at your option) any later version.
8 *
9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
12 * Lesser General Public License for more details.
13 *
14 * You should have received a copy of the GNU Lesser General Public
15 * License along with this library; if not, see <http://www.gnu.org/licenses/>.
16 */
17
18VERSION {
19        /*
20         * The kernel's vdso32.lds.S attempts to export
21         *     __kernel_sigtramp_rt32
22         *     __kernel_restart_syscall32
23         * except that those symbols don't exist.  The actual symbols are
24         *     __kernel_sigtramp_rt
25         *     __kernel_restart_syscall
26         * which means that nothing is exported at all.
27         * QEMU handles syscall restart internally, so we don't
28         * need to implement __kernel_restart_syscall at all.
29         */
30        LINUX_5.18 {
31        local: *;
32        };
33}
34
35
36PHDRS {
37        phdr            PT_PHDR         FLAGS(4) PHDRS;
38        load            PT_LOAD         FLAGS(7) FILEHDR PHDRS;
39        dynamic         PT_DYNAMIC      FLAGS(4);
40        note            PT_NOTE         FLAGS(4);
41        eh_frame_hdr    PT_GNU_EH_FRAME;
42}
43
44SECTIONS {
45        . = SIZEOF_HEADERS;
46
47        /* The following, including the FILEHDRS and PHDRS, are modified
48           when we relocate the binary.  We want them to be initially
49           writable for the relocation; we'll force them read-only after.  */
50        .note           : { *(.note*) }         :load :note
51        .dynamic        : { *(.dynamic) }       :load :dynamic
52        .dynsym         : { *(.dynsym) }        :load
53        .data           : {
54                /* There ought not be any real read-write data.
55                   But since we manipulated the segment layout,
56                   we have to put these sections somewhere.  */
57                *(.data*)
58                *(.sdata*)
59                *(.got.plt) *(.got)
60                *(.gnu.linkonce.d.*)
61                *(.bss*)
62                *(.dynbss*)
63                *(.gnu.linkonce.b.*)
64        }
65
66        .rodata         : { *(.rodata) }
67        .hash           : { *(.hash) }
68        .gnu.hash       : { *(.gnu.hash) }
69        .dynstr         : { *(.dynstr) }
70        .gnu.version    : { *(.gnu.version) }
71        .gnu.version_d  : { *(.gnu.version_d) }
72        .gnu.version_r  : { *(.gnu.version_r) }
73        .eh_frame_hdr   : { *(.eh_frame_hdr) }  :load :eh_frame_hdr
74        .eh_frame       : { *(.eh_frame) }      :load
75
76        .text           : { *(.text*) }         :load
77}
78