From patchwork Tue Jul 6 23:49:16 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 470610 Delivered-To: patch@linaro.org Received: by 2002:a17:906:971a:0:0:0:0 with SMTP id k26csp5550689ejx; Tue, 6 Jul 2021 17:01:26 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwlbi7pAIt2E3lP7DHD/sY/desL2WOrXphQetZZ2cS6qM4GMTh14IrpfS7JJ+Ftq1eSAo0u X-Received: by 2002:a1f:2608:: with SMTP id m8mr16218618vkm.17.1625616086057; Tue, 06 Jul 2021 17:01:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1625616086; cv=none; d=google.com; s=arc-20160816; b=Ettk8amj72U+P1715ryOFHPaR3JHPqxSikyD8GXMJscHQU0nMHscBXs8kvgXt9U4h6 RZ7TM1cPQlrTAGNFRlna2RWVGrq0ZOkewiUBScOBcdkbmYcfu7Nkwof97sPnf6yLXf9t x9+l2zyjFqphbRPDZ6rWpQF2kJP3Kn1i9WlXzPTV7f4xR0j7vQJf6RYYLvW4HnkasRyO 9UYF1pF3kVFGmfSg4POuUQqYAxL9VIRgWw9YDD7rTvk/QflT9myRE2apOumIkcW5xY+E 7lEy+UuvbRb9MD0nYLMBZuOumFN2XW9JhrT8CwYUjxdfByQlgmLMtfKHwNVOTnblR5xc thqA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:to:from :dkim-signature; bh=l6ttjRfQ6jH1AfHE03jdic7003sgS0FcDvhNsfAtMaA=; b=Y0ukwSU259qH6OqSoHfatCSWyBh4hcnyyfnMeYVgZ3akTK85c4nnD8uC10Ug8Hwb/6 EWyV6+Uwa9B4KUNyd/SB/agyNUPsU7I1QN6JH7EPZpB2OhrhtZPfuXLzcBSaAYn+QWe8 TTN+WgZHFU+Qv/byBtzmJ22/jG88n0ot92IiRF9jBIMHWkwa4j5IrQMFMVpIjCLFmePF jElu4gJ61wFEVUbuvU2TwtkSPKRVoqYRz4FjAr0/gC6YvyoD9DSBu4QqgOX5xsbj51+x CISHJIDgVCUXnDM6fDcU40UUE72ruv5y8Zlut0eJ2Hv0NcCFTm+bUNrhD4qiUjPKRBF+ 2m+A== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=KwTveJbr; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id 90si14969510uam.157.2021.07.06.17.01.25 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 06 Jul 2021 17:01:26 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=KwTveJbr; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:44112 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1m0v0H-0007sK-9Z for patch@linaro.org; Tue, 06 Jul 2021 20:01:25 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:53290) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1m0up9-0001U9-BA for qemu-devel@nongnu.org; Tue, 06 Jul 2021 19:49:55 -0400 Received: from mail-pj1-x1032.google.com ([2607:f8b0:4864:20::1032]:42853) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1m0up2-0006eu-33 for qemu-devel@nongnu.org; Tue, 06 Jul 2021 19:49:55 -0400 Received: by mail-pj1-x1032.google.com with SMTP id p17-20020a17090b0111b02901723ab8d11fso485871pjz.1 for ; Tue, 06 Jul 2021 16:49:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=l6ttjRfQ6jH1AfHE03jdic7003sgS0FcDvhNsfAtMaA=; b=KwTveJbrOoSxZbmt5Q7pdYsAO9yUUDeq5VvRHo1UV3AIy69jpAl90a6uQT+z1Ps+3u tpFusvCPfJZ66bRC0NTrE/ULLVOBe5jlH0hv6iICKOlhY7zqfOIODrGQC86XBLkKyy9j L4idkWdfP9Jk8gKdGE4nfjH2LCE2O+dA4AABr2lsIT2e+N50hrn8EWoF6Dei/RGZFA66 UtXonDT+SKAy/QoWXez6dQRAE2QrYJ1l5aATltOQw7Kw+sGVsCWBcLg/FP/dY5RR6LDO gw0Dlsa9ZIJKhD6fVFJgsa/vZFh/uV1BCRHHQfXM4RCBjPLtsDuU01juq2TNblPcBp5M qzgA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=l6ttjRfQ6jH1AfHE03jdic7003sgS0FcDvhNsfAtMaA=; b=nQY4kzDSbN/Au5CzlULhh0oq6NzHjEMYxmaZojzwEeX6Np978EMXUkL6+4v4MWMdvA h3EnKzIlgmOSozOt2lvIR2OyOA0OpWyWVyANMVR/3vphI6/ViKYFyF8FTWnZ79QfOmQS /dkCiBoU5/ILfcEwpDj4inmOaDzSGvUYhgkYLqMBwN+xTXzg7rgY8cse7nO/NgfF93Th p8FS9PQ5bwjTAKDfcrkRaVl2EbzWgDttf4EtyFT0LHxxMHqA8WntbbCjNTUKU/yKfdGZ C0FgwvwOdF/6F5vBx34jJy5qie4IqfRxSveYTsfdO9UoOSRYXUZdLl89e/njwWugKVeu j4gQ== X-Gm-Message-State: AOAM531y74O1OG46lFPX5VAA9OlZ589Y6lxk4tmjaZ7k2dICQmIxQRoB Q8QhCQtP5KLnDR+BvNt5cczrNE24AnGudw== X-Received: by 2002:a17:902:e2d3:b029:129:70aa:990 with SMTP id l19-20020a170902e2d3b029012970aa0990mr15687931plc.34.1625615386478; Tue, 06 Jul 2021 16:49:46 -0700 (PDT) Received: from localhost.localdomain ([71.212.149.176]) by smtp.gmail.com with ESMTPSA id b3sm18058114pfi.179.2021.07.06.16.49.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 06 Jul 2021 16:49:46 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH v2 20/36] linux-user/hppa: Add vdso and use it for rt_sigreturn Date: Tue, 6 Jul 2021 16:49:16 -0700 Message-Id: <20210706234932.356913-21-richard.henderson@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210706234932.356913-1-richard.henderson@linaro.org> References: <20210706234932.356913-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::1032; envelope-from=richard.henderson@linaro.org; helo=mail-pj1-x1032.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: alex.bennee@linaro.org, laurent@vivier.eu Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" Building the vdso itself is not actually wired up to anything, since we require a cross-compiler. Just check in that file for now. Drop the now-unused 9 trampoline words, and describe the frame without the trampoline in __kernel_rt_sigreturn. Signed-off-by: Richard Henderson --- linux-user/elfload.c | 4 + linux-user/hppa/signal.c | 8 +- linux-user/hppa/Makefile.vdso | 6 ++ linux-user/hppa/meson.build | 6 ++ linux-user/hppa/vdso.S | 149 ++++++++++++++++++++++++++++++++++ linux-user/hppa/vdso.ld | 75 +++++++++++++++++ linux-user/hppa/vdso.so | Bin 0 -> 5196 bytes 7 files changed, 241 insertions(+), 7 deletions(-) create mode 100644 linux-user/hppa/Makefile.vdso create mode 100644 linux-user/hppa/vdso.S create mode 100644 linux-user/hppa/vdso.ld create mode 100755 linux-user/hppa/vdso.so diff --git a/linux-user/hppa/vdso.so b/linux-user/hppa/vdso.so new file mode 100755 index 0000000000000000000000000000000000000000..bd77b8a5c33d66380a79b2f816237568998c8af3 GIT binary patch literal 5196 zcmeHLTX2&_6y8m`h?i>1Fr!Y<(V03TLgZ2vMX_m{v|xHmQlRzno08B(+64dnt!Y&# zrJ#tSAYi?V;vMhzD?akzLq~o0rOYtnjH5H?lUl!T|9?q4!-F$E`0}6R%h_|;v%6QP>C*pB(!-jarNeZBIKVIh--%n9~VdDL|l%$<-U@r0?d=`hp5?Q4RN~Mq4!%Rm4%zLDf8@TJBYAN^0$} zx^+aw?o+MztF{MJ`&QMlO?8e+72hsZVoa*!4yn4vrCPUBs`b01+OS8e?%hnkK0EIH zydxN!+)(e6p8-Dueg^yu_!;ms;Ag|OQN+)eJyT*#P!?yV zQ&h9abt&t(0<;koy=|9(# zlb(FGCucpGbvTISruJt&jy<~jlWwgHpMahZ8|PnQ_UGAGK&Q#8tydymxwf{Ny4%97 zYZ_5RqhDY}TC8Y1+#0c3n&QH0j? z-$4&WznP_wIhXHB=Nx>wCo|r07v>$nQtsp6p7eWSyh#^=eGtsk#CXJNfI9k}bfJ4U zP-*hsw1}c#GYt*=_#X9}^vRPP6^7Nd_-O+SnRwMu O%=EJ%j~XX%?e`Db?gR4x literal 0 HcmV?d00001 -- 2.25.1 diff --git a/linux-user/elfload.c b/linux-user/elfload.c index 40cc79b129..ec3a854b44 100644 --- a/linux-user/elfload.c +++ b/linux-user/elfload.c @@ -1496,6 +1496,10 @@ static inline void init_thread(struct target_pt_regs *regs, #define STACK_GROWS_DOWN 0 #define STACK_ALIGNMENT 64 +#include "vdso.c.inc" + +#define vdso_image_info() &vdso_image_info + static inline void init_thread(struct target_pt_regs *regs, struct image_info *infop) { diff --git a/linux-user/hppa/signal.c b/linux-user/hppa/signal.c index 0e266f472d..44e2db6d3e 100644 --- a/linux-user/hppa/signal.c +++ b/linux-user/hppa/signal.c @@ -40,7 +40,6 @@ struct target_ucontext { }; struct target_rt_sigframe { - abi_uint tramp[9]; target_siginfo_t info; struct target_ucontext uc; /* hidden location of upper halves of pa2.0 64-bit gregs */ @@ -138,14 +137,9 @@ void setup_rt_frame(int sig, struct target_sigaction *ka, setup_sigcontext(&frame->uc.tuc_mcontext, env); - __put_user(0x34190000, frame->tramp + 0); /* ldi 0,%r25 */ - __put_user(0x3414015a, frame->tramp + 1); /* ldi __NR_rt_sigreturn,%r20 */ - __put_user(0xe4008200, frame->tramp + 2); /* be,l 0x100(%sr2,%r0) */ - __put_user(0x08000240, frame->tramp + 3); /* nop */ - unlock_user_struct(frame, frame_addr, 1); - env->gr[2] = h2g(frame->tramp); + env->gr[2] = default_rt_sigreturn; env->gr[30] = sp; env->gr[26] = sig; env->gr[25] = h2g(&frame->info); diff --git a/linux-user/hppa/Makefile.vdso b/linux-user/hppa/Makefile.vdso new file mode 100644 index 0000000000..d4362c4961 --- /dev/null +++ b/linux-user/hppa/Makefile.vdso @@ -0,0 +1,6 @@ +CROSS_CC ?= hppa-linux-gnu-gcc + +vdso.so: vdso.S vdso.ld Makefile.vdso + $(CROSS_CC) -nostdlib -shared -Wl,-T,vdso.ld \ + -Wl,-h,linux-vdso.so.1 -Wl,--build-id=sha1 \ + -Wl,--hash-style=sysv vdso.S -o $@ diff --git a/linux-user/hppa/meson.build b/linux-user/hppa/meson.build index 4709508a09..e065a16a96 100644 --- a/linux-user/hppa/meson.build +++ b/linux-user/hppa/meson.build @@ -3,3 +3,9 @@ syscall_nr_generators += { arguments: [ meson.current_source_dir() / 'syscallhdr.sh', '@INPUT@', '@OUTPUT@', '@EXTRA_ARGS@' ], output: '@BASENAME@_nr.h') } + +gen = [ + gen_vdso.process('vdso.so', extra_args: ['-r', '__kernel_rt_sigreturn']) +] + +linux_user_ss.add(when: 'TARGET_HPPA', if_true: gen) diff --git a/linux-user/hppa/vdso.S b/linux-user/hppa/vdso.S new file mode 100644 index 0000000000..eeae2c999a --- /dev/null +++ b/linux-user/hppa/vdso.S @@ -0,0 +1,149 @@ +/* + * hppa linux kernel vdso replacement. + * + * Copyright 2021 Linaro, Ltd. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#include + + .text + +#define sizeof_rt_sigframe 696 +#define offsetof_sigcontext 152 +#define offsetof_sigcontext_gr offsetof_sigcontext + 4 +#define offsetof_sigcontext_fr offsetof_sigcontext_gr + 32 * 4 +#define offsetof_sigcontext_iasq offsetof_sigcontext_fr + 32 * 8 +#define offsetof_sigcontext_iaoq offsetof_sigcontext_iasq + 8 +#define offsetof_sigcontext_sar offsetof_sigcontext_iaoq + 8 + + /* + * While this frame is marked as a signal frame, that only applies + * to how this return address is handled for the outer frame. + * The return address that arrived here, from the inner frame, is + * not marked as a signal frame and so the unwinder still tries to + * subtract 1 to examine the presumed call insn. Thus we must + * extend the unwind info to a nop before the start. + */ + + .cfi_startproc simple + .cfi_signal_frame + + /* Compare pa32_fallback_frame_state from libgcc. */ + + /* Record the size of the stack frame. */ + .cfi_def_cfa 30, -sizeof_rt_sigframe + + /* Record save offset of general registers. */ + .cfi_offset 1, offsetof_sigcontext_gr + 1 * 4 + .cfi_offset 2, offsetof_sigcontext_gr + 2 * 4 + .cfi_offset 3, offsetof_sigcontext_gr + 3 * 4 + .cfi_offset 4, offsetof_sigcontext_gr + 4 * 4 + .cfi_offset 5, offsetof_sigcontext_gr + 5 * 4 + .cfi_offset 6, offsetof_sigcontext_gr + 6 * 4 + .cfi_offset 7, offsetof_sigcontext_gr + 7 * 4 + .cfi_offset 8, offsetof_sigcontext_gr + 8 * 4 + .cfi_offset 9, offsetof_sigcontext_gr + 9 * 4 + .cfi_offset 10, offsetof_sigcontext_gr + 10 * 4 + .cfi_offset 11, offsetof_sigcontext_gr + 11 * 4 + .cfi_offset 12, offsetof_sigcontext_gr + 12 * 4 + .cfi_offset 13, offsetof_sigcontext_gr + 13 * 4 + .cfi_offset 14, offsetof_sigcontext_gr + 14 * 4 + .cfi_offset 15, offsetof_sigcontext_gr + 15 * 4 + .cfi_offset 16, offsetof_sigcontext_gr + 16 * 4 + .cfi_offset 17, offsetof_sigcontext_gr + 17 * 4 + .cfi_offset 18, offsetof_sigcontext_gr + 18 * 4 + .cfi_offset 19, offsetof_sigcontext_gr + 19 * 4 + .cfi_offset 20, offsetof_sigcontext_gr + 20 * 4 + .cfi_offset 21, offsetof_sigcontext_gr + 21 * 4 + .cfi_offset 22, offsetof_sigcontext_gr + 22 * 4 + .cfi_offset 23, offsetof_sigcontext_gr + 23 * 4 + .cfi_offset 24, offsetof_sigcontext_gr + 24 * 4 + .cfi_offset 25, offsetof_sigcontext_gr + 25 * 4 + .cfi_offset 26, offsetof_sigcontext_gr + 26 * 4 + .cfi_offset 27, offsetof_sigcontext_gr + 27 * 4 + .cfi_offset 28, offsetof_sigcontext_gr + 28 * 4 + .cfi_offset 29, offsetof_sigcontext_gr + 29 * 4 + .cfi_offset 30, offsetof_sigcontext_gr + 30 * 4 + .cfi_offset 31, offsetof_sigcontext_gr + 31 * 4 + + /* Record save offset of fp registers, left and right halves. */ + .cfi_offset 32, offsetof_sigcontext_fr + 4 * 8 + .cfi_offset 33, offsetof_sigcontext_fr + 4 * 8 + 4 + .cfi_offset 34, offsetof_sigcontext_fr + 5 * 8 + .cfi_offset 35, offsetof_sigcontext_fr + 5 * 8 + 4 + .cfi_offset 36, offsetof_sigcontext_fr + 6 * 8 + .cfi_offset 37, offsetof_sigcontext_fr + 6 * 8 + 4 + .cfi_offset 38, offsetof_sigcontext_fr + 7 * 8 + .cfi_offset 39, offsetof_sigcontext_fr + 7 * 8 + 4 + .cfi_offset 40, offsetof_sigcontext_fr + 8 * 8 + .cfi_offset 41, offsetof_sigcontext_fr + 8 * 8 + 4 + .cfi_offset 42, offsetof_sigcontext_fr + 9 * 8 + .cfi_offset 43, offsetof_sigcontext_fr + 9 * 8 + 4 + .cfi_offset 44, offsetof_sigcontext_fr + 10 * 8 + .cfi_offset 45, offsetof_sigcontext_fr + 10 * 8 + 4 + .cfi_offset 46, offsetof_sigcontext_fr + 11 * 8 + .cfi_offset 47, offsetof_sigcontext_fr + 11 * 8 + 4 + .cfi_offset 48, offsetof_sigcontext_fr + 12 * 8 + .cfi_offset 49, offsetof_sigcontext_fr + 12 * 8 + 4 + .cfi_offset 50, offsetof_sigcontext_fr + 13 * 8 + .cfi_offset 51, offsetof_sigcontext_fr + 13 * 8 + 4 + .cfi_offset 52, offsetof_sigcontext_fr + 14 * 8 + .cfi_offset 53, offsetof_sigcontext_fr + 14 * 8 + 4 + .cfi_offset 54, offsetof_sigcontext_fr + 15 * 8 + .cfi_offset 55, offsetof_sigcontext_fr + 15 * 8 + 4 + .cfi_offset 56, offsetof_sigcontext_fr + 16 * 8 + .cfi_offset 57, offsetof_sigcontext_fr + 16 * 8 + 4 + .cfi_offset 58, offsetof_sigcontext_fr + 17 * 8 + .cfi_offset 59, offsetof_sigcontext_fr + 17 * 8 + 4 + .cfi_offset 60, offsetof_sigcontext_fr + 18 * 8 + .cfi_offset 61, offsetof_sigcontext_fr + 18 * 8 + 4 + .cfi_offset 62, offsetof_sigcontext_fr + 19 * 8 + .cfi_offset 63, offsetof_sigcontext_fr + 19 * 8 + 4 + .cfi_offset 64, offsetof_sigcontext_fr + 20 * 8 + .cfi_offset 65, offsetof_sigcontext_fr + 20 * 8 + 4 + .cfi_offset 66, offsetof_sigcontext_fr + 21 * 8 + .cfi_offset 67, offsetof_sigcontext_fr + 21 * 8 + 4 + .cfi_offset 68, offsetof_sigcontext_fr + 22 * 8 + .cfi_offset 69, offsetof_sigcontext_fr + 22 * 8 + 4 + .cfi_offset 70, offsetof_sigcontext_fr + 23 * 8 + .cfi_offset 71, offsetof_sigcontext_fr + 23 * 8 + 4 + .cfi_offset 72, offsetof_sigcontext_fr + 24 * 8 + .cfi_offset 73, offsetof_sigcontext_fr + 24 * 8 + 4 + .cfi_offset 74, offsetof_sigcontext_fr + 25 * 8 + .cfi_offset 75, offsetof_sigcontext_fr + 25 * 8 + 4 + .cfi_offset 76, offsetof_sigcontext_fr + 26 * 8 + .cfi_offset 77, offsetof_sigcontext_fr + 26 * 8 + 4 + .cfi_offset 78, offsetof_sigcontext_fr + 27 * 8 + .cfi_offset 79, offsetof_sigcontext_fr + 27 * 8 + 4 + .cfi_offset 80, offsetof_sigcontext_fr + 28 * 8 + .cfi_offset 81, offsetof_sigcontext_fr + 28 * 8 + 4 + .cfi_offset 82, offsetof_sigcontext_fr + 29 * 8 + .cfi_offset 83, offsetof_sigcontext_fr + 29 * 8 + 4 + .cfi_offset 84, offsetof_sigcontext_fr + 30 * 8 + .cfi_offset 85, offsetof_sigcontext_fr + 30 * 8 + 4 + .cfi_offset 86, offsetof_sigcontext_fr + 31 * 8 + .cfi_offset 87, offsetof_sigcontext_fr + 31 * 8 + 4 + + /* Record save offset of %sar */ + .cfi_offset 88, offsetof_sigcontext_sar + + /* Record save offset of return address, iaoq[0]. */ + .cfi_return_column 89 + .cfi_offset 89, offsetof_sigcontext_iaoq + + nop + +__kernel_rt_sigreturn: + + ldi 0, %r25 + ldi __NR_rt_sigreturn, %r20 + be,l 0x100(%sr2, %r0), %sr0, %r31 + nop + + .cfi_endproc + + .size __kernel_rt_sigreturn, . - __kernel_rt_sigreturn + .type __kernel_rt_sigreturn, @function + .globl __kernel_rt_sigreturn diff --git a/linux-user/hppa/vdso.ld b/linux-user/hppa/vdso.ld new file mode 100644 index 0000000000..fed994c3eb --- /dev/null +++ b/linux-user/hppa/vdso.ld @@ -0,0 +1,75 @@ +/* + * Linker script for linux hppa vdso. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, see . + */ + +/* + * Note that the kernel does not implement a vdso for hppa. + * Mirror the symbol that other targets use for this, e.g. i386. + */ + +VERSION { + QEMU { + global: + __kernel_rt_sigreturn; + local: *; + }; +} + + +PHDRS { + phdr PT_PHDR FLAGS(4) PHDRS; + data PT_LOAD FLAGS(6) FILEHDR PHDRS; + text PT_LOAD FLAGS(5); + dynamic PT_DYNAMIC FLAGS(4); + note PT_NOTE FLAGS(4); + eh_frame_hdr PT_GNU_EH_FRAME; +} + +SECTIONS { + . = SIZEOF_HEADERS; + + /* The following, including the FILEHDRS and PHDRS, are modified + when we relocate the binary. We want them to be initially + writable for the relocation; we'll force them read-only after. */ + .note : { *(.note*) } :data :note + .dynamic : { *(.dynamic) } :data :dynamic + .dynsym : { *(.dynsym) } :data + .data : { + /* There ought not be any real read-write data. + But since we manipulated the segment layout, + we have to put these sections somewhere. */ + *(.data*) + *(.sdata*) + *(.got.plt) *(.got) + *(.gnu.linkonce.d.*) + *(.bss*) + *(.dynbss*) + *(.gnu.linkonce.b.*) + } + + .rodata : { *(.rodata) } + .hash : { *(.hash) } + .gnu.hash : { *(.gnu.hash) } + .dynstr : { *(.dynstr) } + .gnu.version : { *(.gnu.version) } + .gnu.version_d : { *(.gnu.version_d) } + .gnu.version_r : { *(.gnu.version_r) } + .eh_frame_hdr : { *(.eh_frame_hdr) } :data :eh_frame_hdr + .eh_frame : { *(.eh_frame) } :data + + . = ALIGN(4096); + .text : { *(.text*) } :text +}