Merge "Add pthread_getname_np."
diff --git a/libc/libc.arm.brillo.map b/libc/libc.arm.brillo.map
index aca1e50..bb5aaa0 100644
--- a/libc/libc.arm.brillo.map
+++ b/libc/libc.arm.brillo.map
@@ -1,4 +1,4 @@
-# Generated by genversionscripts.py. Do not edit.
+# Generated by genversion-scripts.py. Do not edit.
 LIBC {
   global:
     __assert;
diff --git a/libc/libc.arm.map b/libc/libc.arm.map
index 6ccf37e..e77471e 100644
--- a/libc/libc.arm.map
+++ b/libc/libc.arm.map
@@ -1,4 +1,4 @@
-# Generated by genversionscripts.py. Do not edit.
+# Generated by genversion-scripts.py. Do not edit.
 LIBC {
   global:
     __assert;
diff --git a/libc/libc.arm64.map b/libc/libc.arm64.map
index 4622c7f..cef6d4a 100644
--- a/libc/libc.arm64.map
+++ b/libc/libc.arm64.map
@@ -1,4 +1,4 @@
-# Generated by genversionscripts.py. Do not edit.
+# Generated by genversion-scripts.py. Do not edit.
 LIBC {
   global:
     __assert;
diff --git a/libc/libc.mips.brillo.map b/libc/libc.mips.brillo.map
index 3d11408..bdd9faa 100644
--- a/libc/libc.mips.brillo.map
+++ b/libc/libc.mips.brillo.map
@@ -1,4 +1,4 @@
-# Generated by genversionscripts.py. Do not edit.
+# Generated by genversion-scripts.py. Do not edit.
 LIBC {
   global:
     __assert;
diff --git a/libc/libc.mips.map b/libc/libc.mips.map
index 69d8178..08a0a1c 100644
--- a/libc/libc.mips.map
+++ b/libc/libc.mips.map
@@ -1,4 +1,4 @@
-# Generated by genversionscripts.py. Do not edit.
+# Generated by genversion-scripts.py. Do not edit.
 LIBC {
   global:
     __assert;
diff --git a/libc/libc.mips64.map b/libc/libc.mips64.map
index 4622c7f..cef6d4a 100644
--- a/libc/libc.mips64.map
+++ b/libc/libc.mips64.map
@@ -1,4 +1,4 @@
-# Generated by genversionscripts.py. Do not edit.
+# Generated by genversion-scripts.py. Do not edit.
 LIBC {
   global:
     __assert;
diff --git a/libc/libc.x86.brillo.map b/libc/libc.x86.brillo.map
index b717ebe..d50fd48 100644
--- a/libc/libc.x86.brillo.map
+++ b/libc/libc.x86.brillo.map
@@ -1,4 +1,4 @@
-# Generated by genversionscripts.py. Do not edit.
+# Generated by genversion-scripts.py. Do not edit.
 LIBC {
   global:
     __assert;
diff --git a/libc/libc.x86.map b/libc/libc.x86.map
index df28d9a..667ee63 100644
--- a/libc/libc.x86.map
+++ b/libc/libc.x86.map
@@ -1,4 +1,4 @@
-# Generated by genversionscripts.py. Do not edit.
+# Generated by genversion-scripts.py. Do not edit.
 LIBC {
   global:
     __assert;
diff --git a/libc/libc.x86_64.map b/libc/libc.x86_64.map
index 4622c7f..cef6d4a 100644
--- a/libc/libc.x86_64.map
+++ b/libc/libc.x86_64.map
@@ -1,4 +1,4 @@
-# Generated by genversionscripts.py. Do not edit.
+# Generated by genversion-scripts.py. Do not edit.
 LIBC {
   global:
     __assert;
diff --git a/libc/tools/genversion-scripts.py b/libc/tools/genversion-scripts.py
index e15c04e..4f117f6 100755
--- a/libc/tools/genversion-scripts.py
+++ b/libc/tools/genversion-scripts.py
@@ -7,6 +7,7 @@
 import os.path
 import shutil
 import tempfile
+import sys
 
 
 all_arches = ["arm", "arm64", "mips", "mips64", "x86", "x86_64"]
@@ -17,6 +18,8 @@
 libm_script = os.path.join(bionic_libm_root, "libm.map.txt")
 libdl_script = os.path.join(bionic_libdl_root, "libdl.map.txt")
 
+script_name = os.path.basename(sys.argv[0])
+
 # TODO (dimity): generate architecture-specific version scripts as part of build
 
 # temp directory where we store all intermediate files
@@ -26,7 +29,7 @@
 
 bionic_libc_root = os.path.join(os.environ["ANDROID_BUILD_TOP"], "bionic/libc")
 
-warning = "Generated by genversionscripts.py. Do not edit."
+warning = "Generated by %s. Do not edit." % script_name
 
 
 class VersionScriptGenerator(object):
diff --git a/libdl/libdl.arm.map b/libdl/libdl.arm.map
index aa6907a..67c8d08 100644
--- a/libdl/libdl.arm.map
+++ b/libdl/libdl.arm.map
@@ -1,4 +1,4 @@
-# Generated by genversionscripts.py. Do not edit.
+# Generated by genversion-scripts.py. Do not edit.
 
 LIBC {
   global:
diff --git a/libdl/libdl.arm64.map b/libdl/libdl.arm64.map
index c767fb1..4d035f5 100644
--- a/libdl/libdl.arm64.map
+++ b/libdl/libdl.arm64.map
@@ -1,4 +1,4 @@
-# Generated by genversionscripts.py. Do not edit.
+# Generated by genversion-scripts.py. Do not edit.
 
 LIBC {
   global:
diff --git a/libdl/libdl.mips.map b/libdl/libdl.mips.map
index c767fb1..4d035f5 100644
--- a/libdl/libdl.mips.map
+++ b/libdl/libdl.mips.map
@@ -1,4 +1,4 @@
-# Generated by genversionscripts.py. Do not edit.
+# Generated by genversion-scripts.py. Do not edit.
 
 LIBC {
   global:
diff --git a/libdl/libdl.mips64.map b/libdl/libdl.mips64.map
index c767fb1..4d035f5 100644
--- a/libdl/libdl.mips64.map
+++ b/libdl/libdl.mips64.map
@@ -1,4 +1,4 @@
-# Generated by genversionscripts.py. Do not edit.
+# Generated by genversion-scripts.py. Do not edit.
 
 LIBC {
   global:
diff --git a/libdl/libdl.x86.map b/libdl/libdl.x86.map
index c767fb1..4d035f5 100644
--- a/libdl/libdl.x86.map
+++ b/libdl/libdl.x86.map
@@ -1,4 +1,4 @@
-# Generated by genversionscripts.py. Do not edit.
+# Generated by genversion-scripts.py. Do not edit.
 
 LIBC {
   global:
diff --git a/libdl/libdl.x86_64.map b/libdl/libdl.x86_64.map
index c767fb1..4d035f5 100644
--- a/libdl/libdl.x86_64.map
+++ b/libdl/libdl.x86_64.map
@@ -1,4 +1,4 @@
-# Generated by genversionscripts.py. Do not edit.
+# Generated by genversion-scripts.py. Do not edit.
 
 LIBC {
   global:
diff --git a/libm/libm.arm.map b/libm/libm.arm.map
index 8d786c5..a61dc2e 100644
--- a/libm/libm.arm.map
+++ b/libm/libm.arm.map
@@ -1,4 +1,4 @@
-# Generated by genversionscripts.py. Do not edit.
+# Generated by genversion-scripts.py. Do not edit.
 LIBC {
   global:
     __fe_dfl_env;
diff --git a/libm/libm.arm64.map b/libm/libm.arm64.map
index e610a23..11032ca 100644
--- a/libm/libm.arm64.map
+++ b/libm/libm.arm64.map
@@ -1,4 +1,4 @@
-# Generated by genversionscripts.py. Do not edit.
+# Generated by genversion-scripts.py. Do not edit.
 LIBC {
   global:
     __fe_dfl_env;
diff --git a/libm/libm.mips.map b/libm/libm.mips.map
index 44bf167..8353627 100644
--- a/libm/libm.mips.map
+++ b/libm/libm.mips.map
@@ -1,4 +1,4 @@
-# Generated by genversionscripts.py. Do not edit.
+# Generated by genversion-scripts.py. Do not edit.
 LIBC {
   global:
     __fe_dfl_env;
diff --git a/libm/libm.mips64.map b/libm/libm.mips64.map
index e610a23..11032ca 100644
--- a/libm/libm.mips64.map
+++ b/libm/libm.mips64.map
@@ -1,4 +1,4 @@
-# Generated by genversionscripts.py. Do not edit.
+# Generated by genversion-scripts.py. Do not edit.
 LIBC {
   global:
     __fe_dfl_env;
diff --git a/libm/libm.x86.map b/libm/libm.x86.map
index e610a23..11032ca 100644
--- a/libm/libm.x86.map
+++ b/libm/libm.x86.map
@@ -1,4 +1,4 @@
-# Generated by genversionscripts.py. Do not edit.
+# Generated by genversion-scripts.py. Do not edit.
 LIBC {
   global:
     __fe_dfl_env;
diff --git a/libm/libm.x86_64.map b/libm/libm.x86_64.map
index e610a23..11032ca 100644
--- a/libm/libm.x86_64.map
+++ b/libm/libm.x86_64.map
@@ -1,4 +1,4 @@
-# Generated by genversionscripts.py. Do not edit.
+# Generated by genversion-scripts.py. Do not edit.
 LIBC {
   global:
     __fe_dfl_env;
diff --git a/tools/relocation_packer/Android.mk b/tools/relocation_packer/Android.mk
index 2bf77b9..bdb54b7 100644
--- a/tools/relocation_packer/Android.mk
+++ b/tools/relocation_packer/Android.mk
@@ -31,13 +31,10 @@
   src/sleb128.cc \
 
 LOCAL_STATIC_LIBRARIES := libelf libz
-LOCAL_C_INCLUDES := external/elfutils/src/libelf
 LOCAL_MODULE := lib_relocation_packer
 
 LOCAL_CPPFLAGS := $(common_cppflags)
 
-LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk
-
 include $(BUILD_HOST_STATIC_LIBRARY)
 
 include $(CLEAR_VARS)
@@ -45,18 +42,15 @@
 LOCAL_CPP_EXTENSION := .cc
 
 LOCAL_SRC_FILES := src/main.cc
-LOCAL_STATIC_LIBRARIES := lib_relocation_packer libelf libz
+LOCAL_STATIC_LIBRARIES := lib_relocation_packer libelf libz libbase
 
 # Statically linking libc++ to make it work from prebuilts
 LOCAL_CXX_STL := libc++_static
-LOCAL_C_INCLUDES := external/elfutils/src/libelf libnativehelper/include
 
 LOCAL_MODULE := relocation_packer
 
 LOCAL_CPPFLAGS := $(common_cppflags)
 
-LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk
-
 include $(BUILD_HOST_EXECUTABLE)
 
 include $(CLEAR_VARS)
@@ -71,7 +65,6 @@
   src/packer_unittest.cc \
 
 LOCAL_STATIC_LIBRARIES := lib_relocation_packer libelf libz
-LOCAL_C_INCLUDES := external/elfutils/src/libelf
 
 LOCAL_CPPFLAGS := $(common_cppflags)
 
diff --git a/tools/relocation_packer/src/main.cc b/tools/relocation_packer/src/main.cc
index 8e9de6d..d0a0dd4 100644
--- a/tools/relocation_packer/src/main.cc
+++ b/tools/relocation_packer/src/main.cc
@@ -25,7 +25,7 @@
 #include "elf_traits.h"
 #include "libelf.h"
 
-#include "nativehelper/ScopedFd.h"
+#include <android-base/unique_fd.h>
 
 static void PrintUsage(const char* argv0) {
   std::string temporary = argv0;
@@ -94,7 +94,7 @@
   }
 
   const char* file = argv[argc - 1];
-  ScopedFd fd(open(file, O_RDWR));
+  android::base::unique_fd fd(open(file, O_RDWR));
   if (fd.get() == -1) {
     LOG(ERROR) << file << ": " << strerror(errno);
     return 1;