Merge "Fix a broken link in a comment."
diff --git a/libc/Android.bp b/libc/Android.bp
index 74fd22b..d355d4c 100644
--- a/libc/Android.bp
+++ b/libc/Android.bp
@@ -1348,6 +1348,7 @@
         "bionic/getpid.cpp",
         "bionic/gettid.cpp",
         "bionic/__gnu_basename.cpp",
+        "bionic/ifaddrs.cpp",
         "bionic/inotify_init.cpp",
         "bionic/ioctl.cpp",
         "bionic/lchown.cpp",
@@ -1766,7 +1767,6 @@
 
     nocrt: true,
 
-    // special for arm
     arch: {
         arm: {
             //TODO: This is to work around b/24465209. Remove after root cause is fixed
@@ -1774,6 +1774,11 @@
 
             // Don't re-export new/delete and friends, even if the compiler really wants to.
             version_script: "libc.arm.map",
+            product_variables: {
+                brillo: {
+                    version_script: "libc.arm.brillo.map",
+                },
+            },
 
             shared: {
                 srcs: ["arch-arm/bionic/exidx_dynamic.c"],
@@ -1781,6 +1786,8 @@
             static: {
                 srcs: ["arch-arm/bionic/exidx_static.c"],
             },
+
+            // special for arm
             cflags: ["-DCRT_LEGACY_WORKAROUND"],
             srcs: [
                 "arch-arm/bionic/atexit_legacy.c",
@@ -1793,6 +1800,11 @@
         mips: {
             // Don't re-export new/delete and friends, even if the compiler really wants to.
             version_script: "libc.mips.map",
+            product_variables: {
+                brillo: {
+                    version_script: "libc.mips.brillo.map",
+                },
+            },
         },
         mips64: {
             // Don't re-export new/delete and friends, even if the compiler really wants to.
@@ -1804,6 +1816,11 @@
 
             // Don't re-export new/delete and friends, even if the compiler really wants to.
             version_script: "libc.x86.map",
+            product_variables: {
+                brillo: {
+                    version_script: "libc.x86.brillo.map",
+                },
+            },
         },
         x86_64: {
             // Don't re-export new/delete and friends, even if the compiler really wants to.
diff --git a/libc/bionic/system_properties.cpp b/libc/bionic/system_properties.cpp
index 2720455..28cce40 100644
--- a/libc/bionic/system_properties.cpp
+++ b/libc/bionic/system_properties.cpp
@@ -826,6 +826,10 @@
 }
 
 static prop_area* get_prop_area_for_name(const char* name) {
+    if (strncmp(name, "ro.", 3) == 0) {
+        name += 3;
+    }
+
     auto entry = list_find(prefixes, [name](prefix_node* l) {
         return l->prefix[0] == '*' || !strncmp(l->prefix, name, l->prefix_len);
     });
diff --git a/libc/libc.arm.brillo.map b/libc/libc.arm.brillo.map
index fb729d4..30f4d28 100644
--- a/libc/libc.arm.brillo.map
+++ b/libc/libc.arm.brillo.map
@@ -1,6 +1,19 @@
 # Generated by genversionscripts.py. Do not edit.
 LIBC {
   global:
+    __aeabi_atexit; # arm
+    __aeabi_memclr; # arm
+    __aeabi_memclr4; # arm
+    __aeabi_memclr8; # arm
+    __aeabi_memcpy; # arm
+    __aeabi_memcpy4; # arm
+    __aeabi_memcpy8; # arm
+    __aeabi_memmove; # arm
+    __aeabi_memmove4; # arm
+    __aeabi_memmove8; # arm
+    __aeabi_memset; # arm
+    __aeabi_memset4; # arm
+    __aeabi_memset8; # arm
     __assert;
     __assert2;
     __atomic_cmpxchg; # arm
@@ -1256,7 +1269,6 @@
     __accept4; # arm x86 mips
     __adddf3; # arm
     __addsf3; # arm
-    __aeabi_atexit; # arm
     __aeabi_cdcmpeq; # arm
     __aeabi_cdcmple; # arm
     __aeabi_cdrcmple; # arm
@@ -1295,18 +1307,6 @@
     __aeabi_llsl; # arm
     __aeabi_llsr; # arm
     __aeabi_lmul; # arm
-    __aeabi_memclr; # arm
-    __aeabi_memclr4; # arm
-    __aeabi_memclr8; # arm
-    __aeabi_memcpy; # arm
-    __aeabi_memcpy4; # arm
-    __aeabi_memcpy8; # arm
-    __aeabi_memmove; # arm
-    __aeabi_memmove4; # arm
-    __aeabi_memmove8; # arm
-    __aeabi_memset; # arm
-    __aeabi_memset4; # arm
-    __aeabi_memset8; # arm
     __aeabi_ui2d; # arm
     __aeabi_ui2f; # arm
     __aeabi_uidiv; # arm
diff --git a/libc/libc.arm.map b/libc/libc.arm.map
index b9d9f0b..a75bdc2 100644
--- a/libc/libc.arm.map
+++ b/libc/libc.arm.map
@@ -1,6 +1,19 @@
 # Generated by genversionscripts.py. Do not edit.
 LIBC {
   global:
+    __aeabi_atexit; # arm
+    __aeabi_memclr; # arm
+    __aeabi_memclr4; # arm
+    __aeabi_memclr8; # arm
+    __aeabi_memcpy; # arm
+    __aeabi_memcpy4; # arm
+    __aeabi_memcpy8; # arm
+    __aeabi_memmove; # arm
+    __aeabi_memmove4; # arm
+    __aeabi_memmove8; # arm
+    __aeabi_memset; # arm
+    __aeabi_memset4; # arm
+    __aeabi_memset8; # arm
     __assert;
     __assert2;
     __atomic_cmpxchg; # arm
@@ -1257,7 +1270,6 @@
     __accept4; # arm x86 mips
     __adddf3; # arm
     __addsf3; # arm
-    __aeabi_atexit; # arm
     __aeabi_cdcmpeq; # arm
     __aeabi_cdcmple; # arm
     __aeabi_cdrcmple; # arm
@@ -1296,18 +1308,6 @@
     __aeabi_llsl; # arm
     __aeabi_llsr; # arm
     __aeabi_lmul; # arm
-    __aeabi_memclr; # arm
-    __aeabi_memclr4; # arm
-    __aeabi_memclr8; # arm
-    __aeabi_memcpy; # arm
-    __aeabi_memcpy4; # arm
-    __aeabi_memcpy8; # arm
-    __aeabi_memmove; # arm
-    __aeabi_memmove4; # arm
-    __aeabi_memmove8; # arm
-    __aeabi_memset; # arm
-    __aeabi_memset4; # arm
-    __aeabi_memset8; # arm
     __aeabi_ui2d; # arm
     __aeabi_ui2f; # arm
     __aeabi_uidiv; # arm
diff --git a/libc/libc.map.txt b/libc/libc.map.txt
index 4c11ae3..f95bd82 100644
--- a/libc/libc.map.txt
+++ b/libc/libc.map.txt
@@ -1,5 +1,18 @@
 LIBC {
   global:
+    __aeabi_atexit; # arm
+    __aeabi_memclr; # arm
+    __aeabi_memclr4; # arm
+    __aeabi_memclr8; # arm
+    __aeabi_memcpy; # arm
+    __aeabi_memcpy4; # arm
+    __aeabi_memcpy8; # arm
+    __aeabi_memmove; # arm
+    __aeabi_memmove4; # arm
+    __aeabi_memmove8; # arm
+    __aeabi_memset; # arm
+    __aeabi_memset4; # arm
+    __aeabi_memset8; # arm
     __assert;
     __assert2;
     __atomic_cmpxchg; # arm
@@ -1283,7 +1296,6 @@
     __accept4; # arm x86 mips
     __adddf3; # arm
     __addsf3; # arm
-    __aeabi_atexit; # arm
     __aeabi_cdcmpeq; # arm
     __aeabi_cdcmple; # arm
     __aeabi_cdrcmple; # arm
@@ -1322,18 +1334,6 @@
     __aeabi_llsl; # arm
     __aeabi_llsr; # arm
     __aeabi_lmul; # arm
-    __aeabi_memclr; # arm
-    __aeabi_memclr4; # arm
-    __aeabi_memclr8; # arm
-    __aeabi_memcpy; # arm
-    __aeabi_memcpy4; # arm
-    __aeabi_memcpy8; # arm
-    __aeabi_memmove; # arm
-    __aeabi_memmove4; # arm
-    __aeabi_memmove8; # arm
-    __aeabi_memset; # arm
-    __aeabi_memset4; # arm
-    __aeabi_memset8; # arm
     __aeabi_ui2d; # arm
     __aeabi_ui2f; # arm
     __aeabi_uidiv; # arm
diff --git a/libc/private/KernelArgumentBlock.h b/libc/private/KernelArgumentBlock.h
index c8ea497..68d4999 100644
--- a/libc/private/KernelArgumentBlock.h
+++ b/libc/private/KernelArgumentBlock.h
@@ -38,32 +38,25 @@
     argv = reinterpret_cast<char**>(args + 1);
     envp = argv + argc + 1;
 
-    // Skip over all environment variable definitions to find aux vector.
-    // The end of the environment block is marked by two NULL pointers.
+    // Skip over all environment variable definitions to find the aux vector.
+    // The end of the environment block is marked by a NULL pointer.
     char** p = envp;
     while (*p != NULL) {
       ++p;
     }
-    ++p; // Skip second NULL;
+    ++p; // Skip the NULL itself.
 
     auxv = reinterpret_cast<ElfW(auxv_t)*>(p);
   }
 
   // Similar to ::getauxval but doesn't require the libc global variables to be set up,
-  // so it's safe to call this really early on. This function also lets you distinguish
-  // between the inability to find the given type and its value just happening to be 0.
-  unsigned long getauxval(unsigned long type, bool* found_match = NULL) {
+  // so it's safe to call this really early on.
+  unsigned long getauxval(unsigned long type) {
     for (ElfW(auxv_t)* v = auxv; v->a_type != AT_NULL; ++v) {
       if (v->a_type == type) {
-        if (found_match != NULL) {
-            *found_match = true;
-        }
         return v->a_un.a_val;
       }
     }
-    if (found_match != NULL) {
-      *found_match = false;
-    }
     return 0;
   }