Merge "Check return value of scandir in icu.cpp"
diff --git a/benchmarks/pthread_benchmark.cpp b/benchmarks/pthread_benchmark.cpp
index 09654c8..9a68a12 100644
--- a/benchmarks/pthread_benchmark.cpp
+++ b/benchmarks/pthread_benchmark.cpp
@@ -100,7 +100,7 @@
 struct PIMutex {
   pthread_mutex_t mutex;
 
-  PIMutex(int type) {
+  explicit PIMutex(int type) {
     pthread_mutexattr_t attr;
     pthread_mutexattr_init(&attr);
     pthread_mutexattr_settype(&attr, type);
diff --git a/libc/bionic/pthread_internal.cpp b/libc/bionic/pthread_internal.cpp
index 2b7a99a..c058384 100644
--- a/libc/bionic/pthread_internal.cpp
+++ b/libc/bionic/pthread_internal.cpp
@@ -43,7 +43,7 @@
 
 template <bool write> class ScopedRWLock {
  public:
-  ScopedRWLock(pthread_rwlock_t* rwlock) : rwlock_(rwlock) {
+  explicit ScopedRWLock(pthread_rwlock_t* rwlock) : rwlock_(rwlock) {
     (write ? pthread_rwlock_wrlock : pthread_rwlock_rdlock)(rwlock_);
   }
 
diff --git a/libc/malloc_debug/PointerData.h b/libc/malloc_debug/PointerData.h
index b05a763..6955c9a 100644
--- a/libc/malloc_debug/PointerData.h
+++ b/libc/malloc_debug/PointerData.h
@@ -112,7 +112,7 @@
 
 class PointerData : public OptionData {
  public:
-  PointerData(DebugData* debug_data);
+  explicit PointerData(DebugData* debug_data);
   virtual ~PointerData() = default;
 
   bool Initialize(const Config& config);
diff --git a/libc/private/ScopedReaddir.h b/libc/private/ScopedReaddir.h
index dc22309..9a20c09 100644
--- a/libc/private/ScopedReaddir.h
+++ b/libc/private/ScopedReaddir.h
@@ -22,10 +22,10 @@
 
 class ScopedReaddir {
  public:
-  ScopedReaddir(const char* path) : ScopedReaddir(opendir(path)) {
+  explicit ScopedReaddir(const char* path) : ScopedReaddir(opendir(path)) {
   }
 
-  ScopedReaddir(DIR* dir) {
+  explicit ScopedReaddir(DIR* dir) {
     dir_ = dir;
   }
 
diff --git a/libc/private/ScopedSignalHandler.h b/libc/private/ScopedSignalHandler.h
index dd5823f..7031752 100644
--- a/libc/private/ScopedSignalHandler.h
+++ b/libc/private/ScopedSignalHandler.h
@@ -33,7 +33,7 @@
     sigaction64(signal_number_, &action_, &old_action_);
   }
 
-  ScopedSignalHandler(int signal_number) : signal_number_(signal_number) {
+  explicit ScopedSignalHandler(int signal_number) : signal_number_(signal_number) {
     sigaction64(signal_number, nullptr, &old_action_);
   }
 
diff --git a/libc/private/bionic_lock.h b/libc/private/bionic_lock.h
index eebfeff..410e637 100644
--- a/libc/private/bionic_lock.h
+++ b/libc/private/bionic_lock.h
@@ -78,7 +78,7 @@
 
 class LockGuard {
  public:
-  LockGuard(Lock& lock) : lock_(lock) {
+  explicit LockGuard(Lock& lock) : lock_(lock) {
     lock_.lock();
   }
   ~LockGuard() {
diff --git a/linker/linker_relocs.h b/linker/linker_relocs.h
index 4bab0e0..68191f9 100644
--- a/linker/linker_relocs.h
+++ b/linker/linker_relocs.h
@@ -34,30 +34,46 @@
 
 #if defined (__aarch64__)
 
-#define R_GENERIC_JUMP_SLOT R_AARCH64_JUMP_SLOT
-#define R_GENERIC_GLOB_DAT  R_AARCH64_GLOB_DAT
-#define R_GENERIC_RELATIVE  R_AARCH64_RELATIVE
-#define R_GENERIC_IRELATIVE R_AARCH64_IRELATIVE
+#define R_GENERIC_JUMP_SLOT     R_AARCH64_JUMP_SLOT
+#define R_GENERIC_GLOB_DAT      R_AARCH64_GLOB_DAT
+#define R_GENERIC_RELATIVE      R_AARCH64_RELATIVE
+#define R_GENERIC_IRELATIVE     R_AARCH64_IRELATIVE
+#define R_GENERIC_TLS_DTPMOD    R_AARCH64_TLS_DTPMOD64
+#define R_GENERIC_TLS_DTPREL    R_AARCH64_TLS_DTPREL64
+#define R_GENERIC_TLS_TPREL     R_AARCH64_TLS_TPREL64
+#define R_GENERIC_TLSDESC       R_AARCH64_TLSDESC
 
 #elif defined (__arm__)
 
-#define R_GENERIC_JUMP_SLOT R_ARM_JUMP_SLOT
-#define R_GENERIC_GLOB_DAT  R_ARM_GLOB_DAT
-#define R_GENERIC_RELATIVE  R_ARM_RELATIVE
-#define R_GENERIC_IRELATIVE R_ARM_IRELATIVE
+#define R_GENERIC_JUMP_SLOT     R_ARM_JUMP_SLOT
+#define R_GENERIC_GLOB_DAT      R_ARM_GLOB_DAT
+#define R_GENERIC_RELATIVE      R_ARM_RELATIVE
+#define R_GENERIC_IRELATIVE     R_ARM_IRELATIVE
+#define R_GENERIC_TLS_DTPMOD    R_ARM_TLS_DTPMOD32
+#define R_GENERIC_TLS_DTPREL    R_ARM_TLS_DTPOFF32
+#define R_GENERIC_TLS_TPREL     R_ARM_TLS_TPOFF32
+#define R_GENERIC_TLSDESC       R_ARM_TLS_DESC
 
 #elif defined (__i386__)
 
-#define R_GENERIC_JUMP_SLOT R_386_JMP_SLOT
-#define R_GENERIC_GLOB_DAT  R_386_GLOB_DAT
-#define R_GENERIC_RELATIVE  R_386_RELATIVE
-#define R_GENERIC_IRELATIVE R_386_IRELATIVE
+#define R_GENERIC_JUMP_SLOT     R_386_JMP_SLOT
+#define R_GENERIC_GLOB_DAT      R_386_GLOB_DAT
+#define R_GENERIC_RELATIVE      R_386_RELATIVE
+#define R_GENERIC_IRELATIVE     R_386_IRELATIVE
+#define R_GENERIC_TLS_DTPMOD    R_386_TLS_DTPMOD32
+#define R_GENERIC_TLS_DTPREL    R_386_TLS_DTPOFF32
+#define R_GENERIC_TLS_TPREL     R_386_TLS_TPOFF
+#define R_GENERIC_TLSDESC       R_386_TLS_DESC
 
 #elif defined (__x86_64__)
 
-#define R_GENERIC_JUMP_SLOT R_X86_64_JUMP_SLOT
-#define R_GENERIC_GLOB_DAT  R_X86_64_GLOB_DAT
-#define R_GENERIC_RELATIVE  R_X86_64_RELATIVE
-#define R_GENERIC_IRELATIVE R_X86_64_IRELATIVE
+#define R_GENERIC_JUMP_SLOT     R_X86_64_JUMP_SLOT
+#define R_GENERIC_GLOB_DAT      R_X86_64_GLOB_DAT
+#define R_GENERIC_RELATIVE      R_X86_64_RELATIVE
+#define R_GENERIC_IRELATIVE     R_X86_64_IRELATIVE
+#define R_GENERIC_TLS_DTPMOD    R_X86_64_DTPMOD64
+#define R_GENERIC_TLS_DTPREL    R_X86_64_DTPOFF64
+#define R_GENERIC_TLS_TPREL     R_X86_64_TPOFF64
+#define R_GENERIC_TLSDESC       R_X86_64_TLSDESC
 
 #endif
diff --git a/tests/grp_pwd_file_test.cpp b/tests/grp_pwd_file_test.cpp
index 2cbad62..66866fb 100644
--- a/tests/grp_pwd_file_test.cpp
+++ b/tests/grp_pwd_file_test.cpp
@@ -26,7 +26,7 @@
 template <typename T>
 class FileUnmapper {
  public:
-  FileUnmapper(T& file) : file_(file) {
+  explicit FileUnmapper(T& file) : file_(file) {
   }
   ~FileUnmapper() {
     file_.Unmap();
diff --git a/tests/libs/thread_local_dtor.cpp b/tests/libs/thread_local_dtor.cpp
index cefff7a..90fd418 100644
--- a/tests/libs/thread_local_dtor.cpp
+++ b/tests/libs/thread_local_dtor.cpp
@@ -30,7 +30,7 @@
 
 class TestClass {
  public:
-  TestClass(bool* flag) : flag_(flag) {}
+  explicit TestClass(bool* flag) : flag_(flag) {}
   ~TestClass() {
     *flag_ = true;
   }
diff --git a/tests/libs/thread_local_dtor2.cpp b/tests/libs/thread_local_dtor2.cpp
index 9b2b164..177c91b 100644
--- a/tests/libs/thread_local_dtor2.cpp
+++ b/tests/libs/thread_local_dtor2.cpp
@@ -30,7 +30,7 @@
 
 class TestClass {
  public:
-  TestClass(bool* flag) : flag_(flag) {}
+  explicit TestClass(bool* flag) : flag_(flag) {}
   ~TestClass() {
     *flag_ = true;
   }
diff --git a/tests/stack_protector_test_helper.cpp b/tests/stack_protector_test_helper.cpp
index 3f15a12..2db4ef1 100644
--- a/tests/stack_protector_test_helper.cpp
+++ b/tests/stack_protector_test_helper.cpp
@@ -21,6 +21,6 @@
   // the line of defense *after* that.
   // Without volatile, the generic x86/x86-64 targets don't write to the stack.
   volatile char* p = buf;
-  int size = static_cast<int>(sizeof(buf) + 1);
+  int size = static_cast<int>(sizeof(buf) + sizeof(void*));
   while ((p - buf) < size) *p++ = '\0';
 }