OSDN Git Service

Fix library lookup for filenames with slash.
authorDmitriy Ivanov <dimitry@google.com>
Wed, 18 Mar 2015 00:12:18 +0000 (17:12 -0700)
committerDmitriy Ivanov <dimitry@google.com>
Wed, 18 Mar 2015 17:32:11 +0000 (10:32 -0700)
  If filename contains a slash, then it is interpreted
  as a (relative or absolute) pathname.

Bug: https://code.google.com/p/android/issues/detail?id=6670
Change-Id: Iba57d638301f3089ad47ba083edca2dd36b801ed

linker/linker.cpp

index 15ea423..3960f9a 100644 (file)
@@ -942,12 +942,8 @@ static int open_library(const char* name, off64_t* file_offset) {
     int fd = TEMP_FAILURE_RETRY(open(name, O_RDONLY | O_CLOEXEC));
     if (fd != -1) {
       *file_offset = 0;
-      return fd;
     }
-    // ...but nvidia binary blobs (at least) rely on this behavior, so fall through for now.
-#if defined(__LP64__)
-    return -1;
-#endif
+    return fd;
   }
 
   // Otherwise we try LD_LIBRARY_PATH first, and fall back to the built-in well known paths.