public inbox for libc-alpha@sourceware.org
 help / color / mirror / Atom feed
From: caiyinyu <caiyinyu@loongson.cn>
To: libc-alpha@sourceware.org, adhemerval.zanella@linaro.org
Cc: joseph_myers@mentor.com, xuchenghua@loongson.cn, caiyinyu@loongson.cn
Subject: [PATCH v3 03/13] LoongArch: Add relocations and ELF flags to elf.h
Date: Fri, 15 Apr 2022 09:31:04 +0800	[thread overview]
Message-ID: <20220415013114.29658-4-caiyinyu@loongson.cn> (raw)
In-Reply-To: <20220415013114.29658-1-caiyinyu@loongson.cn>

---
 elf/elf.h | 68 ++++++++++++++++++++++++++++++++++++++++++++++++++++++-
 1 file changed, 67 insertions(+), 1 deletion(-)

diff --git a/elf/elf.h b/elf/elf.h
index 0735f6b579..6e0cd65a9b 100644
--- a/elf/elf.h
+++ b/elf/elf.h
@@ -358,8 +358,9 @@ typedef struct
 
 #define EM_BPF		247	/* Linux BPF -- in-kernel virtual machine */
 #define EM_CSKY		252     /* C-SKY */
+#define EM_LOONGARCH	258	/* LoongArch */
 
-#define EM_NUM		253
+#define EM_NUM		259
 
 /* Old spellings/synonyms.  */
 
@@ -4056,6 +4057,71 @@ enum
 #define R_NDS32_TLS_TPOFF	102
 #define R_NDS32_TLS_DESC	119
 
+/* LoongArch ELF Flags */
+#define EF_LARCH_ABI    	0x07
+#define EF_LARCH_ABI_LP64D	0x03
+
+/* LoongArch specific dynamic relocations */
+#define R_LARCH_NONE		0
+#define R_LARCH_32		1
+#define R_LARCH_64		2
+#define R_LARCH_RELATIVE	3
+#define R_LARCH_COPY		4
+#define R_LARCH_JUMP_SLOT	5
+#define R_LARCH_TLS_DTPMOD32	6
+#define R_LARCH_TLS_DTPMOD64	7
+#define R_LARCH_TLS_DTPREL32	8
+#define R_LARCH_TLS_DTPREL64	9
+#define R_LARCH_TLS_TPREL32	10
+#define R_LARCH_TLS_TPREL64	11
+#define R_LARCH_IRELATIVE	12
+
+/* Reserved for future relocs that the dynamic linker must understand.  */
+
+/* used by the static linker for relocating .text.  */
+#define R_LARCH_MARK_LA  20
+#define R_LARCH_MARK_PCREL  21
+#define R_LARCH_SOP_PUSH_PCREL  22
+#define R_LARCH_SOP_PUSH_ABSOLUTE  23
+#define R_LARCH_SOP_PUSH_DUP  24
+#define R_LARCH_SOP_PUSH_GPREL  25
+#define R_LARCH_SOP_PUSH_TLS_TPREL  26
+#define R_LARCH_SOP_PUSH_TLS_GOT  27
+#define R_LARCH_SOP_PUSH_TLS_GD  28
+#define R_LARCH_SOP_PUSH_PLT_PCREL  29
+#define R_LARCH_SOP_ASSERT  30
+#define R_LARCH_SOP_NOT  31
+#define R_LARCH_SOP_SUB  32
+#define R_LARCH_SOP_SL  33
+#define R_LARCH_SOP_SR  34
+#define R_LARCH_SOP_ADD  35
+#define R_LARCH_SOP_AND  36
+#define R_LARCH_SOP_IF_ELSE  37
+#define R_LARCH_SOP_POP_32_S_10_5  38
+#define R_LARCH_SOP_POP_32_U_10_12  39
+#define R_LARCH_SOP_POP_32_S_10_12  40
+#define R_LARCH_SOP_POP_32_S_10_16  41
+#define R_LARCH_SOP_POP_32_S_10_16_S2  42
+#define R_LARCH_SOP_POP_32_S_5_20  43
+#define R_LARCH_SOP_POP_32_S_0_5_10_16_S2  44
+#define R_LARCH_SOP_POP_32_S_0_10_10_16_S2  45
+#define R_LARCH_SOP_POP_32_U  46
+
+/* used by the static linker for relocating non .text.  */
+#define R_LARCH_ADD8  47
+#define R_LARCH_ADD16  48
+#define R_LARCH_ADD24  49
+#define R_LARCH_ADD32  50
+#define R_LARCH_ADD64  51
+#define R_LARCH_SUB8  52
+#define R_LARCH_SUB16  53
+#define R_LARCH_SUB24  54
+#define R_LARCH_SUB32  55
+#define R_LARCH_SUB64  56
+#define R_LARCH_GNU_VTINHERIT  57
+#define R_LARCH_GNU_VTENTRY  58
+
+
 /* ARCompact/ARCv2 specific relocs.  */
 #define R_ARC_NONE		0x0
 #define R_ARC_8			0x1
-- 
2.20.1


  parent reply	other threads:[~2022-04-15  1:31 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-04-15  1:31 [PATCH v3 00/13] GLIBC LoongArch PATCHES caiyinyu
2022-04-15  1:31 ` [PATCH v3 01/13] LoongArch: Update NEWS and README for the LoongArch port caiyinyu
2022-04-19 20:06   ` Joseph Myers
2022-05-09  2:26     ` caiyinyu
2022-04-15  1:31 ` [PATCH v3 02/13] LoongArch: Add LoongArch entries to config.h.in caiyinyu
2022-04-15  1:31 ` caiyinyu [this message]
2022-04-15  1:31 ` [PATCH v3 04/13] LoongArch: ABI Implementation caiyinyu
2022-04-15  1:31 ` [PATCH v3 05/13] LoongArch: Thread-Local Storage Support caiyinyu
2022-04-15  1:31 ` [PATCH v3 06/13] LoongArch: Generic <math.h> and soft-fp Routines caiyinyu
2022-04-15  1:31 ` [PATCH v3 07/13] LoongArch: Atomic and Locking Routines caiyinyu
2022-04-15  1:31 ` [PATCH v3 08/13] LoongArch: Linux Syscall Interface caiyinyu
2022-04-15  1:31 ` [PATCH v3 09/13] LoongArch: Linux ABI caiyinyu
2022-04-15  1:31 ` [PATCH v3 10/13] LoongArch: Add ABI Lists caiyinyu
2022-04-15  1:31 ` [PATCH v3 11/13] LoongArch: Build Infastructure caiyinyu
2022-04-15  1:31 ` [PATCH v3 12/13] LoongArch: Hard Float Support caiyinyu
2022-04-15  1:31 ` [PATCH v3 13/13] LoongArch: Update build-many-glibcs.py for the LoongArch Port caiyinyu

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=20220415013114.29658-4-caiyinyu@loongson.cn \
    --to=caiyinyu@loongson.cn \
    --cc=adhemerval.zanella@linaro.org \
    --cc=joseph_myers@mentor.com \
    --cc=libc-alpha@sourceware.org \
    --cc=xuchenghua@loongson.cn \
    /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: link
Be 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).