[PATCH] [lld] Fix wrong content permission bit.

Rui Ueyama ruiu at google.com
Thu May 16 17:44:22 PDT 2013


Hi kledzik,

"W" bit value was not consistent in ContentPermissions enum. It should always be 2.

http://llvm-reviews.chandlerc.com/D810

Files:
  include/lld/Core/DefinedAtom.h

Index: include/lld/Core/DefinedAtom.h
===================================================================
--- include/lld/Core/DefinedAtom.h
+++ include/lld/Core/DefinedAtom.h
@@ -146,14 +146,17 @@
     typeTLVInitializerPtr,  // pointer to thread local initializer [Darwin]
   };
 
+  // Permission bits for atoms and segments. The order of these values are
+  // important, because the layout pass may sort atoms by permission if other
+  // attributes are the same.
   enum ContentPermissions {
     perm___  = 0,           // mapped as unaccessible
     permR__  = 8,           // mapped read-only
     permRW_  = 8 + 2,       // mapped readable and writable
-    permR_X  = 8 + 4,       // mapped readable and executable
-    permRWX  = 8 + 4 + 2,   // mapped readable and writable and executable
-    permRW_L = 8 + 4 + 1,   // initially mapped r/w, then made read-only
+    permRW_L = 8 + 2 + 1,   // initially mapped r/w, then made read-only
                             // loader writable
+    permR_X  = 8 + 4,       // mapped readable and executable
+    permRWX  = 8 + 2 + 4,   // mapped readable and writable and executable
     permUnknown = 16        // unknown or invalid permissions
   };
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D810.1.patch
Type: text/x-patch
Size: 1208 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20130516/6a44ae9f/attachment.bin>


More information about the llvm-commits mailing list