COFF: Fix .reloc section attributes.
authorRui Ueyama <ruiu@google.com>
Mon, 15 Jun 2015 18:03:47 +0000 (18:03 +0000)
committerRui Ueyama <ruiu@google.com>
Mon, 15 Jun 2015 18:03:47 +0000 (18:03 +0000)
llvm-svn: 239738

lld/COFF/Writer.h
lld/test/COFF/baserel.test

index 0db88b7..1e4a9b9 100644 (file)
@@ -20,9 +20,9 @@
 namespace lld {
 namespace coff {
 
-// Mask for section types (code, data or bss) and permissions
-// (writable, readable or executable).
-const uint32_t PermMask = 0xF00000F0;
+// Mask for section types (code, data, bss, disacardable, etc.)
+// and permissions (writable, readable or executable).
+const uint32_t PermMask = 0xFF0000F0;
 
 // OutputSection represents a section in an output file. It's a
 // container of chunks. OutputSection and Chunk are 1:N relationship.
index 7313854..6c54310 100644 (file)
@@ -66,7 +66,8 @@ BASEREL-HEADER-NEXT: PointerToRelocations: 0x0
 BASEREL-HEADER-NEXT: PointerToLineNumbers: 0x0
 BASEREL-HEADER-NEXT: RelocationCount: 0
 BASEREL-HEADER-NEXT: LineNumberCount: 0
-BASEREL-HEADER-NEXT: Characteristics [ (0x40000040)
+BASEREL-HEADER-NEXT: Characteristics [ (0x42000040)
 BASEREL-HEADER-NEXT:   IMAGE_SCN_CNT_INITIALIZED_DATA (0x40)
+BASEREL-HEADER-NEXT:   IMAGE_SCN_MEM_DISCARDABLE (0x2000000)
 BASEREL-HEADER-NEXT:   IMAGE_SCN_MEM_READ (0x40000000)
 BASEREL-HEADER-NEXT: ]