Move __dso_handle to RELRO

Most DSOs have a RELRO segment, but some of them have nothing except
__dso_handle in their .data section.  This means __dso_handle is taking
up a page as well as a vm_area_struct in kernel slabs for those DSOs.

Let's move it to the RELRO segment to save memory.

On a 32-bit device I tested on, I saw ~400 KB less slab usage on
vm_area_struct.  To control for difference in number of cached
processes, I also measured with Android stopped, and I saw ~100 KB less
slab usage.  Summing up all dirty pages attributed to shared libraries,
I saw 5.6 MB less dirty pages.

Test: Build and boot.
Change-Id: Ib88e49f1c72352e610affc19623895d954110d4e
diff --git a/libc/arch-common/bionic/__dso_handle_so.h b/libc/arch-common/bionic/__dso_handle_so.h
index e2c26b6..2c0df7b 100644
--- a/libc/arch-common/bionic/__dso_handle_so.h
+++ b/libc/arch-common/bionic/__dso_handle_so.h
@@ -26,4 +26,14 @@
  * SUCH DAMAGE.
  */
 
-__attribute__((__visibility__("hidden"))) void* __dso_handle = &__dso_handle;
+/*
+ * We would like __dso_handle to be:
+ *   1. A const so that if a DSO does not have any RW data, .data section can
+ *      be omitted.
+ *   2. Of type void* so that no awkward type conversion is needed when
+ *      &__dso_handle is passed to various functions, which all expect a void*.
+ * To achieve both, we do the following aliasing trick.
+ */
+static const void* const __dso_handle_const = &__dso_handle_const;
+__attribute__((__visibility__("hidden")))
+__attribute__((alias("__dso_handle_const"))) extern void* __dso_handle;