Mark Wielaard 9e628c
diff --git a/backends/i386_reloc.def b/backends/i386_reloc.def
Mark Wielaard 9e628c
index de3575d..a6a03f3 100644
Mark Wielaard 9e628c
--- a/backends/i386_reloc.def
Mark Wielaard 9e628c
+++ b/backends/i386_reloc.def
Mark Wielaard 9e628c
@@ -68,3 +68,4 @@ RELOC_TYPE (TLS_GOTDESC,	REL)
Mark Wielaard 9e628c
 RELOC_TYPE (TLS_DESC_CALL,	REL)
Mark Wielaard 9e628c
 RELOC_TYPE (TLS_DESC,		EXEC)
Mark Wielaard 9e628c
 RELOC_TYPE (IRELATIVE,		EXEC|DYN)
Mark Wielaard 9e628c
+RELOC_TYPE (GOT32X,		REL)
Mark Wielaard 9e628c
diff --git a/backends/x86_64_reloc.def b/backends/x86_64_reloc.def
Mark Wielaard 9e628c
index ad84efa..07a7c3d 100644
Mark Wielaard 9e628c
--- a/backends/x86_64_reloc.def
Mark Wielaard 9e628c
+++ b/backends/x86_64_reloc.def
Mark Wielaard 9e628c
@@ -61,3 +61,5 @@ RELOC_TYPE (GOTPC32_TLSDESC, REL)
Mark Wielaard 9e628c
 RELOC_TYPE (TLSDESC_CALL, REL)
Mark Wielaard 9e628c
 RELOC_TYPE (TLSDESC,	REL|EXEC|DYN)
Mark Wielaard 9e628c
 RELOC_TYPE (IRELATIVE,	EXEC|DYN)
Mark Wielaard 9e628c
+RELOC_TYPE (GOTPCRELX,	REL)
Mark Wielaard 9e628c
+RELOC_TYPE (REX_GOTPCRELX, REL)
Mark Wielaard 9e628c
diff --git a/libelf/elf.h b/libelf/elf.h
Mark Wielaard 9e628c
index 12feb91..1a7000b 100644
Mark Wielaard 9e628c
--- a/libelf/elf.h
Mark Wielaard 9e628c
+++ b/libelf/elf.h
Mark Wielaard 9e628c
@@ -1,5 +1,5 @@
Mark Wielaard 9e628c
 /* This file defines standard ELF types, structures, and macros.
Mark Wielaard 9e628c
-   Copyright (C) 1995-2015 Free Software Foundation, Inc.
Mark Wielaard 9e628c
+   Copyright (C) 1995-2016 Free Software Foundation, Inc.
Mark Wielaard 9e628c
    This file is part of the GNU C Library.
Mark Wielaard 9e628c
 
Mark Wielaard 9e628c
    The GNU C Library is free software; you can redistribute it and/or
Mark Wielaard 9e628c
@@ -1269,8 +1269,10 @@ typedef struct
Mark Wielaard 9e628c
 					   argument, returning the TLS
Mark Wielaard 9e628c
 					   offset for the symbol.  */
Mark Wielaard 9e628c
 #define R_386_IRELATIVE	   42		/* Adjust indirectly by program base */
Mark Wielaard 9e628c
+#define R_386_GOT32X	   43		/* Load from 32 bit GOT entry,
Mark Wielaard 9e628c
+					   relaxable. */
Mark Wielaard 9e628c
 /* Keep this the last entry.  */
Mark Wielaard 9e628c
-#define R_386_NUM	   43
Mark Wielaard 9e628c
+#define R_386_NUM	   44
Mark Wielaard 9e628c
 
Mark Wielaard 9e628c
 /* SUN SPARC specific definitions.  */
Mark Wielaard 9e628c
 
Mark Wielaard 9e628c
@@ -1727,7 +1729,11 @@ typedef struct
Mark Wielaard 9e628c
    PLT is writable.  For a non-writable PLT, this is omitted or has a zero
Mark Wielaard 9e628c
    value.  */
Mark Wielaard 9e628c
 #define DT_MIPS_RWPLT        0x70000034
Mark Wielaard 9e628c
-#define DT_MIPS_NUM	     0x35
Mark Wielaard 9e628c
+/* An alternative description of the classic MIPS RLD_MAP that is usable
Mark Wielaard 9e628c
+   in a PIE as it stores a relative offset from the address of the tag
Mark Wielaard 9e628c
+   rather than an absolute address.  */
Mark Wielaard 9e628c
+#define DT_MIPS_RLD_MAP_REL  0x70000035
Mark Wielaard 9e628c
+#define DT_MIPS_NUM	     0x36
Mark Wielaard 9e628c
 
Mark Wielaard 9e628c
 /* Legal values for DT_MIPS_FLAGS Elf32_Dyn entry.  */
Mark Wielaard 9e628c
 
Mark Wielaard 9e628c
@@ -3140,8 +3146,15 @@ enum
Mark Wielaard 9e628c
 #define R_X86_64_TLSDESC        36	/* TLS descriptor.  */
Mark Wielaard 9e628c
 #define R_X86_64_IRELATIVE	37	/* Adjust indirectly by program base */
Mark Wielaard 9e628c
 #define R_X86_64_RELATIVE64	38	/* 64-bit adjust by program base */
Mark Wielaard 9e628c
-
Mark Wielaard 9e628c
-#define R_X86_64_NUM		39
Mark Wielaard 9e628c
+					/* 39 Reserved was R_X86_64_PC32_BND */
Mark Wielaard 9e628c
+					/* 40 Reserved was R_X86_64_PLT32_BND */
Mark Wielaard 9e628c
+#define R_X86_64_GOTPCRELX	41	/* Load from 32 bit signed pc relative
Mark Wielaard 9e628c
+					   offset to GOT entry without REX
Mark Wielaard 9e628c
+					   prefix, relaxable.  */
Mark Wielaard 9e628c
+#define R_X86_64_REX_GOTPCRELX	42	/* Load from 32 bit signed pc relative
Mark Wielaard 9e628c
+					   offset to GOT entry with REX prefix,
Mark Wielaard 9e628c
+					   relaxable.  */
Mark Wielaard 9e628c
+#define R_X86_64_NUM		43
Mark Wielaard 9e628c
 
Mark Wielaard 9e628c
 
Mark Wielaard 9e628c
 /* AM33 relocations.  */