[v3,05/19] Add RISC-V dynamic relocations to elf.h

Message ID 20171227060534.3998-6-palmer@dabbelt.com
State New, archived
Headers

Commit Message

Palmer Dabbelt Dec. 27, 2017, 6:05 a.m. UTC
  These relocations can appear in shared objects on RISC-V ELF systems.
---
 elf/elf.h | 14 ++++++++++++++
 1 file changed, 14 insertions(+)
  

Comments

Joseph Myers Jan. 1, 2018, 2 a.m. UTC | #1
On Tue, 26 Dec 2017, Palmer Dabbelt wrote:

> These relocations can appear in shared objects on RISC-V ELF systems.

OK, please commit, with an appropriate ChangeLog entry.
  

Patch

diff --git a/elf/elf.h b/elf/elf.h
index 01a43ce9ac51..bf10ade6639b 100644
--- a/elf/elf.h
+++ b/elf/elf.h
@@ -3762,6 +3762,20 @@  enum
 
 #define R_TILEGX_NUM		130
 
+/* RISC-V relocations.  */
+#define R_RISCV_NONE          0
+#define R_RISCV_32            1
+#define R_RISCV_64            2
+#define R_RISCV_RELATIVE      3
+#define R_RISCV_COPY          4
+#define R_RISCV_JUMP_SLOT     5
+#define R_RISCV_TLS_DTPMOD32  6
+#define R_RISCV_TLS_DTPMOD64  7
+#define R_RISCV_TLS_DTPREL32  8
+#define R_RISCV_TLS_DTPREL64  9
+#define R_RISCV_TLS_TPREL32  10
+#define R_RISCV_TLS_TPREL64  11
+
 /* BPF specific declarations.  */
 
 #define R_BPF_NONE		0	/* No reloc */