xref: /openbmc/qemu/linux-user/aarch64/vdso.ld (revision 516fffc9933cb21fad41ca8f7bf465d238d4d375)
1*ee95fae0SRichard Henderson/*
2*ee95fae0SRichard Henderson * Linker script for linux aarch64 replacement vdso.
3*ee95fae0SRichard Henderson *
4*ee95fae0SRichard Henderson * Copyright 2021 Linaro, Ltd.
5*ee95fae0SRichard Henderson *
6*ee95fae0SRichard Henderson * SPDX-License-Identifier: GPL-2.0-or-later
7*ee95fae0SRichard Henderson */
8*ee95fae0SRichard Henderson
9*ee95fae0SRichard HendersonVERSION {
10*ee95fae0SRichard Henderson        LINUX_2.6.39 {
11*ee95fae0SRichard Henderson        global:
12*ee95fae0SRichard Henderson                __kernel_rt_sigreturn;
13*ee95fae0SRichard Henderson                __kernel_gettimeofday;
14*ee95fae0SRichard Henderson                __kernel_clock_gettime;
15*ee95fae0SRichard Henderson                __kernel_clock_getres;
16*ee95fae0SRichard Henderson
17*ee95fae0SRichard Henderson        local: *;
18*ee95fae0SRichard Henderson        };
19*ee95fae0SRichard Henderson}
20*ee95fae0SRichard Henderson
21*ee95fae0SRichard Henderson
22*ee95fae0SRichard HendersonPHDRS {
23*ee95fae0SRichard Henderson        phdr            PT_PHDR         FLAGS(4) PHDRS;
24*ee95fae0SRichard Henderson        load            PT_LOAD         FLAGS(7) FILEHDR PHDRS;
25*ee95fae0SRichard Henderson        dynamic         PT_DYNAMIC      FLAGS(4);
26*ee95fae0SRichard Henderson        eh_frame_hdr    PT_GNU_EH_FRAME;
27*ee95fae0SRichard Henderson        note            PT_NOTE         FLAGS(4);
28*ee95fae0SRichard Henderson}
29*ee95fae0SRichard Henderson
30*ee95fae0SRichard HendersonSECTIONS {
31*ee95fae0SRichard Henderson        /*
32*ee95fae0SRichard Henderson         * We can't prelink to any address without knowing something about
33*ee95fae0SRichard Henderson         * the virtual memory space of the host, since that leaks over into
34*ee95fae0SRichard Henderson         * the available memory space of the guest.
35*ee95fae0SRichard Henderson         */
36*ee95fae0SRichard Henderson        . = SIZEOF_HEADERS;
37*ee95fae0SRichard Henderson
38*ee95fae0SRichard Henderson        /*
39*ee95fae0SRichard Henderson         * The following, including the FILEHDRS and PHDRS, are modified
40*ee95fae0SRichard Henderson         * when we relocate the binary.  We want them to be initially
41*ee95fae0SRichard Henderson         * writable for the relocation; we'll force them read-only after.
42*ee95fae0SRichard Henderson         */
43*ee95fae0SRichard Henderson        .note           : { *(.note*) }         :load :note
44*ee95fae0SRichard Henderson        .dynamic        : { *(.dynamic) }       :load :dynamic
45*ee95fae0SRichard Henderson        .dynsym         : { *(.dynsym) }        :load
46*ee95fae0SRichard Henderson        /*
47*ee95fae0SRichard Henderson         * There ought not be any real read-write data.
48*ee95fae0SRichard Henderson         * But since we manipulated the segment layout,
49*ee95fae0SRichard Henderson         * we have to put these sections somewhere.
50*ee95fae0SRichard Henderson         */
51*ee95fae0SRichard Henderson        .data           : {
52*ee95fae0SRichard Henderson                *(.data*)
53*ee95fae0SRichard Henderson                *(.sdata*)
54*ee95fae0SRichard Henderson                *(.got.plt) *(.got)
55*ee95fae0SRichard Henderson                *(.gnu.linkonce.d.*)
56*ee95fae0SRichard Henderson                *(.bss*)
57*ee95fae0SRichard Henderson                *(.dynbss*)
58*ee95fae0SRichard Henderson                *(.gnu.linkonce.b.*)
59*ee95fae0SRichard Henderson        }
60*ee95fae0SRichard Henderson
61*ee95fae0SRichard Henderson        .rodata         : { *(.rodata*) }
62*ee95fae0SRichard Henderson        .hash           : { *(.hash) }
63*ee95fae0SRichard Henderson        .gnu.hash       : { *(.gnu.hash) }
64*ee95fae0SRichard Henderson        .dynstr         : { *(.dynstr) }
65*ee95fae0SRichard Henderson        .gnu.version    : { *(.gnu.version) }
66*ee95fae0SRichard Henderson        .gnu.version_d  : { *(.gnu.version_d) }
67*ee95fae0SRichard Henderson        .gnu.version_r  : { *(.gnu.version_r) }
68*ee95fae0SRichard Henderson        .eh_frame_hdr   : { *(.eh_frame_hdr) }  :load :eh_frame_hdr
69*ee95fae0SRichard Henderson        .eh_frame       : { *(.eh_frame) }      :load
70*ee95fae0SRichard Henderson
71*ee95fae0SRichard Henderson        .text           : { *(.text*) }         :load   =0xd503201f
72*ee95fae0SRichard Henderson}
73