public inbox for glibc-cvs@sourceware.org help / color / mirror / Atom feed
From: Szabolcs Nagy <nsz@sourceware.org> To: glibc-cvs@sourceware.org Subject: [glibc/arm/morello/main] aarch64: morello: add lazy binding entry code Date: Wed, 26 Oct 2022 15:20:14 +0000 (GMT) [thread overview] Message-ID: <20221026152014.E0D2C3882148@sourceware.org> (raw) https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=5d3a018154c231c893b5465078e95971bf1f78aa commit 5d3a018154c231c893b5465078e95971bf1f78aa Author: Szabolcs Nagy <szabolcs.nagy@arm.com> Date: Fri Jul 8 16:35:35 2022 +0100 aarch64: morello: add lazy binding entry code Diff: --- sysdeps/aarch64/morello/dl-trampoline.S | 136 ++++++++++++++++++++++++++++++++ 1 file changed, 136 insertions(+) diff --git a/sysdeps/aarch64/morello/dl-trampoline.S b/sysdeps/aarch64/morello/dl-trampoline.S new file mode 100644 index 0000000000..f94eff4a2b --- /dev/null +++ b/sysdeps/aarch64/morello/dl-trampoline.S @@ -0,0 +1,136 @@ +/* Copyright (C) 2005-2022 Free Software Foundation, Inc. + + This file is part of the GNU C Library. + + The GNU C 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.1 of the + License, or (at your option) any later version. + + The GNU C 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 the GNU C Library. If not, see + <https://www.gnu.org/licenses/>. */ + +#include <sysdep.h> +#include <libc-symbols.h> + +#include "dl-link.h" + +#define ip0 c16 +#define ip0l c16 +#define ip1 c17 +#define lr c30 + +#define RELA_SIZE 24 + + .text + .globl _dl_runtime_resolve + .type _dl_runtime_resolve, #function + cfi_startproc + .align 2 +_dl_runtime_resolve: + /* Morello we get called with: + ip0 &PLTGOT[2] + ip1 temp(dl resolver entry point) + [sp, #16] lr + [sp, #0] &PLTGOT[n] + */ + + cfi_rel_offset (lr, 16) + + /* Save arguments. */ + stp c8, c9, [csp, #-(160+8*16)]! + cfi_adjust_cfa_offset (160+8*16) + cfi_rel_offset (c8, 0) + cfi_rel_offset (c9, 16) + + stp c6, c7, [csp, #32] + cfi_rel_offset (c6, 32) + cfi_rel_offset (c7, 48) + + stp c4, c5, [csp, #64] + cfi_rel_offset (c4, 64) + cfi_rel_offset (c5, 80) + + stp c2, c3, [csp, #96] + cfi_rel_offset (c2, 96) + cfi_rel_offset (c3, 112) + + stp c0, c1, [csp, #128] + cfi_rel_offset (c0, 128) + cfi_rel_offset (c1, 144) + + stp q0, q1, [csp, #(160+0*16)] + cfi_rel_offset (q0, 160+0*16) + cfi_rel_offset (q1, 160+1*16) + + stp q2, q3, [csp, #(160+2*16)] + cfi_rel_offset (q0, 160+2*16) + cfi_rel_offset (q1, 160+3*16) + + stp q4, q5, [csp, #(160+4*16)] + cfi_rel_offset (q0, 160+4*16) + cfi_rel_offset (q1, 160+5*16) + + stp q6, q7, [csp, #(160+6*16)] + cfi_rel_offset (q0, 160+6*16) + cfi_rel_offset (q1, 160+7*16) + + /* Get pointer to linker struct. */ + ldr c0, [ip0, #-PTR_SIZE] + + /* Prepare to call _dl_fixup(). */ + ldr c1, [csp, 160+8*16] /* Recover &PLTGOT[n] */ + + sub x1, x1, x16 + add x1, x1, x1, lsl #1 + lsr x1, x1, #1 + sub x1, x1, #RELA_SIZE + + /* Call fixup routine. */ + bl _dl_fixup + + /* Save the return. */ + mov ip0, c0 + + /* Get arguments and return address back. */ + ldp q0, q1, [csp, #(160+0*16)] + ldp q2, q3, [csp, #(160+2*16)] + ldp q4, q5, [csp, #(160+4*16)] + ldp q6, q7, [csp, #(160+6*16)] + ldp c0, c1, [csp, #128] + ldp c2, c3, [csp, #96] + ldp c4, c5, [csp, #64] + ldp c6, c7, [csp, #32] + ldp c8, c9, [csp], #(160+8*16) + cfi_adjust_cfa_offset (-(160+8*16)) + + ldp ip1, lr, [csp], #32 + cfi_adjust_cfa_offset (-32) + + /* Jump to the newly found address. */ + br ip0 + + cfi_endproc + .size _dl_runtime_resolve, .-_dl_runtime_resolve +#ifndef PROF + .globl _dl_runtime_profile + .type _dl_runtime_profile, #function + cfi_startproc + .align 2 +_dl_runtime_profile: + + /* TODO: requires definition of La_aarch64_* layout + and register state saved correctly for varargs ABI. */ + mov x0, 0 + ldr c0, [c0] + + cfi_endproc + .size _dl_runtime_profile, .-_dl_runtime_profile +#endif + .previous
next reply other threads:[~2022-10-26 15:20 UTC|newest] Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top 2022-10-26 15:20 Szabolcs Nagy [this message] -- strict thread matches above, loose matches on Subject: below -- 2022-11-23 14:48 Szabolcs Nagy 2022-10-27 13:58 Szabolcs Nagy 2022-08-05 19:36 Szabolcs Nagy
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=20221026152014.E0D2C3882148@sourceware.org \ --to=nsz@sourceware.org \ --cc=glibc-cvs@sourceware.org \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).