Reviewers: Søren Gjesse,

Description:
[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.

Please review this at http://codereview.chromium.org/661467

Affected files:
  M src/platform-linux.cc


Index: src/platform-linux.cc
diff --git a/src/platform-linux.cc b/src/platform-linux.cc
index e890f94aad39190ad78bd2a99338404a7358a8db..066128965e302f14f7fde62a1a4bd906697b1e2c 100644
--- a/src/platform-linux.cc
+++ b/src/platform-linux.cc
@@ -331,8 +331,8 @@ void OS::LogSharedLibraryAddresses() {
if (fscanf(fp, " %c%c%c%c", &attr_r, &attr_w, &attr_x, &attr_p) != 4) break;

     int c;
-    if (attr_r == 'r' && attr_x == 'x') {
- // Found a readable and executable entry. Skip characters until we reach
+    if (attr_r == 'r' && attr_w != 'w' && attr_x == 'x') {
+      // Found a read-only executable entry. Skip characters until we reach
       // the beginning of the filename or the end of the line.
       do {
         c = getc(fp);


--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev

Reply via email to