1 /* PLT trampolines. ARC version.
2 Copyright (C) 2020-2024 Free Software Foundation, Inc.
3 This file is part of the GNU C Library.
5 The GNU C Library is free software; you can redistribute it and/or
6 modify it under the terms of the GNU Lesser General Public
7 License as published by the Free Software Foundation; either
8 version 2.1 of the License, or (at your option) any later version.
10 The GNU C Library is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 Lesser General Public License for more details.
15 You should have received a copy of the GNU Lesser General Public
16 License along with the GNU C Library. If not, see
17 <https://www.gnu.org/licenses/>. */
20 #include <libc-symbols.h>
23 #include <sys/syscall.h>
25 /* resolver has atypical calling ABI (r11 and r12)
26 PLTn which lands us here, sets up
27 r11 = Module info (tpnt pointer as expected by resolver)
28 r12 = PC of the PLTn itself - needed by resolver to find
29 corresponding .rela.plt entry. */
31 ENTRY (_dl_runtime_resolve)
33 /* save args to func being resolved before entering resolver. */
44 cfi_adjust_cfa_offset (40)
46 cfi_adjust_cfa_offset (4)
47 cfi_rel_offset (blink, 0)
53 /* restore regs back. */
55 cfi_adjust_cfa_offset (-4)
66 cfi_adjust_cfa_offset (-36)
68 j_s.d [r0] /* r0 has resolved function addr. */
69 pop_s r0 /* restore first arg to resolved call. */
70 cfi_adjust_cfa_offset (-4)
72 END (_dl_runtime_resolve)