blob: 677d516338635a8ee8fd44070653fe2105047a78 [file] [log] [blame]
Proposal for adding SHT_RELR sections in generic-abi is at
https://groups.google.com/forum/#!topic/generic-abi/bX460iggiKg
Experimental support for SHT_RELR sections is available in the aosp
binutils repository, with the section type and dynamic array tags
defined in the OS specific range.
This patch moves those definitions to the generic range so we can load
binaries containing SHT_RELR sections using the experimental support in
sys-libs/glibc.
SHT_RELR sections are supported for arm, aarch64, and x86_64 targets.
To enable them, pass '--experimental-use-relr' flag to gold.
Definitions for the new ELF section type and dynamic array tags, as well
as the encoding used in the new section are all under discussion and are
subject to change. We plan to send the patch upstream after the gABI has
been updated to include the new definitions.
--- binutils-2.27/elfcpp/elfcpp.h
+++ binutils-2.27/elfcpp/elfcpp.h
@@ -357,6 +357,7 @@ enum SHT
SHT_PREINIT_ARRAY = 16,
SHT_GROUP = 17,
SHT_SYMTAB_SHNDX = 18,
+ SHT_RELR = 19,
SHT_LOOS = 0x60000000,
SHT_HIOS = 0x6fffffff,
SHT_LOPROC = 0x70000000,
@@ -385,10 +386,6 @@ enum SHT
SHT_SUNW_versym = 0x6fffffff,
SHT_GNU_versym = 0x6fffffff,
- // Experimental support for SHT_RELR sections. For details, see proposal
- // at https://groups.google.com/forum/#!topic/generic-abi/bX460iggiKg
- SHT_RELR = 0x6fffff00,
-
SHT_SPARC_GOTDATA = 0x70000000,
// ARM-specific section types.
@@ -722,6 +719,11 @@ enum DT
DT_PREINIT_ARRAY = 32,
DT_PREINIT_ARRAYSZ = 33,
+ DT_SYMTAB_SHNDX = 34,
+ DT_RELRSZ = 35,
+ DT_RELR = 36,
+ DT_RELRENT = 37,
+
DT_LOOS = 0x6000000d,
DT_HIOS = 0x6ffff000,
DT_LOPROC = 0x70000000,
@@ -756,6 +758,7 @@ enum DT
DT_SYMINFO = 0x6ffffeff,
DT_ADDRRNGHI = 0x6ffffeff,
+ DT_RELRCOUNT = 0x6ffffff8,
DT_RELACOUNT = 0x6ffffff9,
DT_RELCOUNT = 0x6ffffffa,
DT_FLAGS_1 = 0x6ffffffb,
@@ -766,13 +769,6 @@ enum DT
DT_VERSYM = 0x6ffffff0,
- // Experimental support for SHT_RELR sections. For details, see proposal
- // at https://groups.google.com/forum/#!topic/generic-abi/bX460iggiKg
- DT_RELR = 0x6fffe000,
- DT_RELRSZ = 0x6fffe001,
- DT_RELRENT = 0x6fffe003,
- DT_RELRCOUNT = 0x6fffe005,
-
// Specify the value of _GLOBAL_OFFSET_TABLE_.
DT_PPC_GOT = 0x70000000,
--- binutils-2.27/include/elf/common.h
+++ binutils-2.27/include/elf/common.h
@@ -470,6 +470,7 @@
#define SHT_PREINIT_ARRAY 16 /* Array of ptrs to pre-init funcs */
#define SHT_GROUP 17 /* Section contains a section group */
#define SHT_SYMTAB_SHNDX 18 /* Indicies for SHN_XINDEX entries */
+#define SHT_RELR 19 /* Relative relocations, only offsets */
#define SHT_LOOS 0x60000000 /* First of OS specific semantics */
#define SHT_HIOS 0x6fffffff /* Last of OS specific semantics */
@@ -490,10 +491,6 @@
#define SHT_GNU_verneed SHT_SUNW_verneed
#define SHT_GNU_versym SHT_SUNW_versym
-/* Experimental support for SHT_RELR sections. For details, see proposal
- at https://groups.google.com/forum/#!topic/generic-abi/bX460iggiKg */
-#define SHT_RELR 0x6fffff00 /* Relative relocations, only offsets */
-
#define SHT_LOPROC 0x70000000 /* Processor-specific semantics, lo */
#define SHT_HIPROC 0x7FFFFFFF /* Processor-specific semantics, hi */
#define SHT_LOUSER 0x80000000 /* Application-specific semantics */
@@ -778,6 +775,11 @@
#define DT_ENCODING 32
#define DT_PREINIT_ARRAY 32
#define DT_PREINIT_ARRAYSZ 33
+#define DT_SYMTAB_SHNDX 34
+#define DT_RELRSZ 35
+#define DT_RELR 36
+#define DT_RELRENT 37
+
/* Note, the Oct 4, 1999 draft of the ELF ABI changed the values
for DT_LOOS and DT_HIOS. Some implementations however, use
@@ -824,6 +826,7 @@
#define DT_SYMINFO 0x6ffffeff
#define DT_ADDRRNGHI 0x6ffffeff
+#define DT_RELRCOUNT 0x6ffffff8
#define DT_RELACOUNT 0x6ffffff9
#define DT_RELCOUNT 0x6ffffffa
#define DT_FLAGS_1 0x6ffffffb
@@ -835,13 +838,6 @@
/* This tag is a GNU extension to the Solaris version scheme. */
#define DT_VERSYM 0x6ffffff0
-/* Experimental support for SHT_RELR sections. For details, see proposal
- at https://groups.google.com/forum/#!topic/generic-abi/bX460iggiKg */
-#define DT_RELR 0x6fffe000
-#define DT_RELRSZ 0x6fffe001
-#define DT_RELRENT 0x6fffe003
-#define DT_RELRCOUNT 0x6fffe005
-
#define DT_LOPROC 0x70000000
#define DT_HIPROC 0x7fffffff