OSDN Git Service

linker: stat /proc/self/exe instead of executable_path
authorDimitry Ivanov <dimitry@google.com>
Thu, 25 Aug 2016 21:53:35 +0000 (14:53 -0700)
committerDimitry Ivanov <dimitry@google.com>
Fri, 26 Aug 2016 02:33:14 +0000 (02:33 +0000)
commitf98712990344c78f6d844b3b81bb284c5b550d94
tree7ead2ae862fc60cf7bb30e3b847a8cc94f8bf64e
parent5aa67675f853af9588ac9274ecf86d7858695ce2
linker: stat /proc/self/exe instead of executable_path

The absolute path to an executable may no longer be valid for
example when the file is unlinked immediately after exec.
Using /proc/self/exe instead of absolute path solves this problem.

Bug: http://b/31084669
Test: Run the app from http://b/31084669 make sure executable starts
Test: by checking ps and /proc/<pid>/exe
Change-Id: I5c819f39ef0fc4fc71b05de71e8af9ede611f04c
(cherry picked from commit 7da4bbbe87a7eca742c6c45a76aaf191aa70d948)
linker/linker.cpp