diff mbox series

[v4,03/15] ARC: startup and dynamic linking code

Message ID 20200313030419.15843-4-vgupta@synopsys.com
State New
Headers show
Series glibc port to ARC processors | expand

Commit Message

Michael Kerrisk \(man-pages\) via Libc-alpha March 13, 2020, 3:04 a.m. UTC
Code for C runtime startup and dynamic loading including PLT layout.

Signed-off-by: Vineet Gupta <vgupta@synopsys.com>
---
 sysdeps/arc/bits/link.h   |  52 ++++++
 sysdeps/arc/dl-machine.h  | 340 ++++++++++++++++++++++++++++++++++++++
 sysdeps/arc/entry.h       |   5 +
 sysdeps/arc/ldsodefs.h    |  43 +++++
 sysdeps/arc/sotruss-lib.c |  51 ++++++
 sysdeps/arc/start.S       |  71 ++++++++
 sysdeps/arc/tst-audit.h   |  23 +++
 7 files changed, 585 insertions(+)
 create mode 100644 sysdeps/arc/bits/link.h
 create mode 100644 sysdeps/arc/dl-machine.h
 create mode 100644 sysdeps/arc/entry.h
 create mode 100644 sysdeps/arc/ldsodefs.h
 create mode 100644 sysdeps/arc/sotruss-lib.c
 create mode 100644 sysdeps/arc/start.S
 create mode 100644 sysdeps/arc/tst-audit.h

Comments

Joseph Myers March 26, 2020, 1:55 a.m. UTC | #1
On Thu, 12 Mar 2020, Vineet Gupta via Libc-alpha wrote:

> +        case R_ARC_TLS_DTPOFF:
> +          if (sym != NULL)
> +            /* Offset set by the linker in the GOT entry would be overwritten
> +               by dynamic loader instead of added to the symbol location.
> +               Other target have the same approach on DTSOFF relocs.  */

Do you mean DTPOFF?  Otherwise I'm not sure what DTSOFF is.
Michael Kerrisk \(man-pages\) via Libc-alpha March 26, 2020, 2:45 a.m. UTC | #2
On 3/25/20 6:55 PM, Joseph Myers wrote:
> Do you mean DTPOFF?  Otherwise I'm not sure what DTSOFF is.

Fixed.
diff mbox series

Patch

diff --git a/sysdeps/arc/bits/link.h b/sysdeps/arc/bits/link.h
new file mode 100644
index 000000000000..0acbc1349e08
--- /dev/null
+++ b/sysdeps/arc/bits/link.h
@@ -0,0 +1,52 @@ 
+/* Machine-specific declarations for dynamic linker interface, ARC version.
+   Copyright (C) 2009-2020 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/>.  */
+
+#ifndef	_LINK_H
+# error "Never include <bits/link.h> directly; use <link.h> instead."
+#endif
+
+/* Registers for entry into PLT on ARC.  */
+typedef struct La_arc_regs
+{
+  uint32_t lr_reg[8]; /* r0 through r7 (upto 8 args).  */
+} La_arc_regs;
+
+/* Return values for calls from PLT on ARC.  */
+typedef struct La_arc_retval
+{
+  /* For ARCv2, a 64-bit integer return value can use 2 regs.  */
+  uint32_t lrv_reg[2];
+} La_arc_retval;
+
+__BEGIN_DECLS
+
+extern ElfW(Addr) la_arc_gnu_pltenter (ElfW(Sym) *__sym, unsigned int __ndx,
+					 uintptr_t *__refcook,
+					 uintptr_t *__defcook,
+					 La_arc_regs *__regs,
+					 unsigned int *__