Merge "Add more missing ELF structures/constants."
diff --git a/android-changes-for-ndk-developers.md b/android-changes-for-ndk-developers.md
index 0620d9e..48800ca 100644
--- a/android-changes-for-ndk-developers.md
+++ b/android-changes-for-ndk-developers.md
@@ -360,23 +360,30 @@
 
 ## Enable logging of dlopen/dlsym and library loading errors for apps (Available in Android O)
 
-Starting with Android O it is possible to enable logging of all dlsym/dlopen calls
-for debuggable apps. Here is short instruction on how to do that:
+Starting with Android O it is possible to enable logging of dynamic
+linker activity for debuggable apps by setting a property corresponding
+to the fully-qualified name of the specific app:
 ```
-adb shell setprop debug.ld.app.com.example.myapp dlsym,dlopen,dlerror
+adb shell setprop debug.ld.app.com.example.myapp dlerror,dlopen,dlsym
 adb logcat
 ```
 
-Any subset of (dlsym,dlopen,dlerror) can be used.
+Any combination of `dlerror`, `dlopen`, and `dlsym` can be used. There's
+no separate `dlclose` option: `dlopen` covers both loading and unloading
+of libraries. Note also that `dlerror` doesn't correspond to actual
+calls of dlerror(3) but to any time the dynamic linker writes to its
+internal error buffer, so you'll see any errors the dynamic linker would
+have reported, even if the code you're debugging doesn't actually call
+dlerror(3) itself.
 
-On userdebug and eng builds it is possible to enable tracing for the whole system
-by using debug.ld.all system property instead of app-specific one:
+On userdebug and eng builds it is possible to enable tracing for the
+whole system by using the `debug.ld.all` system property instead of
+app-specific one. For example, to enable logging of all dlopen(3)
+(and thus dclose(3)) calls, and all failures, but not dlsym(3) calls:
 ```
 adb shell setprop debug.ld.all dlerror,dlopen
 ```
 
-enables logging of all errors and dlopen calls
-
 ## dlclose interacts badly with thread local variables with non-trivial destructors
 
 Android allows `dlclose` to unload a library even if there are still
diff --git a/libc/include/paths.h b/libc/include/paths.h
index d2c5956..922d1ce 100644
--- a/libc/include/paths.h
+++ b/libc/include/paths.h
@@ -38,7 +38,7 @@
 #define	_PATH_BSHELL	"/system/bin/sh"
 #endif
 #define	_PATH_CONSOLE	"/dev/console"
-#define	_PATH_DEFPATH	"/sbin:/system/sbin:/system/bin:/system/xbin:/vendor/bin:/vendor/xbin"
+#define	_PATH_DEFPATH	"/sbin:/system/sbin:/system/bin:/system/xbin:/odm/bin:/vendor/bin:/vendor/xbin"
 #define	_PATH_DEV	"/dev/"
 #define	_PATH_DEVNULL	"/dev/null"
 #define	_PATH_KLOG	"/proc/kmsg"
diff --git a/linker/linker.cpp b/linker/linker.cpp
index 66ae191..7bf3a5b 100644
--- a/linker/linker.cpp
+++ b/linker/linker.cpp
@@ -90,13 +90,17 @@
 
 #if defined(__LP64__)
 static const char* const kSystemLibDir     = "/system/lib64";
+static const char* const kOdmLibDir        = "/odm/lib64";
 static const char* const kVendorLibDir     = "/vendor/lib64";
 static const char* const kAsanSystemLibDir = "/data/asan/system/lib64";
+static const char* const kAsanOdmLibDir    = "/data/asan/odm/lib64";
 static const char* const kAsanVendorLibDir = "/data/asan/vendor/lib64";
 #else
 static const char* const kSystemLibDir     = "/system/lib";
+static const char* const kOdmLibDir        = "/odm/lib";
 static const char* const kVendorLibDir     = "/vendor/lib";
 static const char* const kAsanSystemLibDir = "/data/asan/system/lib";
+static const char* const kAsanOdmLibDir    = "/data/asan/odm/lib";
 static const char* const kAsanVendorLibDir = "/data/asan/vendor/lib";
 #endif
 
@@ -104,6 +108,7 @@
 
 static const char* const kDefaultLdPaths[] = {
   kSystemLibDir,
+  kOdmLibDir,
   kVendorLibDir,
   nullptr
 };
@@ -111,6 +116,8 @@
 static const char* const kAsanDefaultLdPaths[] = {
   kAsanSystemLibDir,
   kSystemLibDir,
+  kAsanOdmLibDir,
+  kOdmLibDir,
   kAsanVendorLibDir,
   kVendorLibDir,
   nullptr