elf.h: move all the Android extensions together.
...and document them slightly better.
Test: N/A
Change-Id: I32ad209f4086f617978c093782ac45977561445f
diff --git a/libc/include/elf.h b/libc/include/elf.h
index bebaea1..a319abb 100644
--- a/libc/include/elf.h
+++ b/libc/include/elf.h
@@ -248,12 +248,6 @@
#define DT_RELR 36
#define DT_RELRENT 37
-/* Android compressed rel/rela sections */
-#define DT_ANDROID_REL (DT_LOOS + 2)
-#define DT_ANDROID_RELSZ (DT_LOOS + 3)
-#define DT_ANDROID_RELA (DT_LOOS + 4)
-#define DT_ANDROID_RELASZ (DT_LOOS + 5)
-
#define DT_GNU_HASH 0x6ffffef5
#define DT_TLSDESC_PLT 0x6ffffef6
#define DT_TLSDESC_GOT 0x6ffffef7
@@ -535,12 +529,28 @@
/*
* Experimental support for SHT_RELR sections. For details, see proposal
* at https://groups.google.com/forum/#!topic/generic-abi/bX460iggiKg.
+ *
* This was eventually replaced by SHT_RELR and DT_RELR (which are identical
* other than their different constants), but those constants are only
- * supported by the OS starting at API level 30.
+ * supported by the OS in API levels >= 30.
*/
#define SHT_ANDROID_RELR 0x6fffff00
#define DT_ANDROID_RELR 0x6fffe000
#define DT_ANDROID_RELRSZ 0x6fffe001
#define DT_ANDROID_RELRENT 0x6fffe003
#define DT_ANDROID_RELRCOUNT 0x6fffe005
+
+/*
+ * Android compressed REL/RELA sections. These were generated by the relocation
+ * packer in old versions of Android, and can be generated directly by lld
+ * with https://reviews.llvm.org/D39152.
+ *
+ * This was replaced by SHT_ANDROID_RELR in API level 28 (but is supported
+ * in all API levels >= 23).
+ */
+#define SHT_ANDROID_REL 0x60000001
+#define SHT_ANDROID_RELA 0x60000002
+#define DT_ANDROID_REL 0x6000000f // DT_LOOS + 2
+#define DT_ANDROID_RELSZ 0x60000010 // DT_LOOS + 3
+#define DT_ANDROID_RELA 0x60000011 // DT_LOOS + 4
+#define DT_ANDROID_RELASZ 0x60000012 // DT_LOOS + 5