[Linux] Patch LogSharedLibraryAddresses to work correctly on Android.

On 'usual' Linux systems in '/proc/self/maps' we encounter two entries
per library: one has 'rw-p' attrs and the other has 'r-xp'. While on
Android, I see 'rwxp' and 'r-xp' (both entries are marked executable.)
So I've added an explicit check for non-writability to leave only a
single record in the log file.

Review URL: http://codereview.chromium.org/661467

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@4018 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
parent af3fc276
...@@ -331,8 +331,8 @@ void OS::LogSharedLibraryAddresses() { ...@@ -331,8 +331,8 @@ void OS::LogSharedLibraryAddresses() {
if (fscanf(fp, " %c%c%c%c", &attr_r, &attr_w, &attr_x, &attr_p) != 4) break; if (fscanf(fp, " %c%c%c%c", &attr_r, &attr_w, &attr_x, &attr_p) != 4) break;
int c; int c;
if (attr_r == 'r' && attr_x == 'x') { if (attr_r == 'r' && attr_w != 'w' && attr_x == 'x') {
// Found a readable and executable entry. Skip characters until we reach // Found a read-only executable entry. Skip characters until we reach
// the beginning of the filename or the end of the line. // the beginning of the filename or the end of the line.
do { do {
c = getc(fp); c = getc(fp);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment