2011-09-27 Kai Tietz <ktietz@redhat.com>
authorKai Tietz <kai.tietz@onevision.com>
Tue, 27 Sep 2011 18:57:22 +0000 (18:57 +0000)
committerKai Tietz <kai.tietz@onevision.com>
Tue, 27 Sep 2011 18:57:22 +0000 (18:57 +0000)
       * config/obj-coff.c (obj_coff_section): Add 'e' as specifier
       for marking section SEC_EXCLUDE.

2011-09-27  Kai Tietz  <ktietz@redhat.com>

       * gas/pe/pe.exp: Add new testcase.
       * gas/pe/section-exclude.d: New file.
       * gas/pe/section-exclude.s: New file.

gas/ChangeLog
gas/config/obj-coff.c
gas/testsuite/ChangeLog
gas/testsuite/gas/pe/pe.exp
gas/testsuite/gas/pe/section-exclude.d [new file with mode: 0644]
gas/testsuite/gas/pe/section-exclude.s [new file with mode: 0644]

index 4d0d622fde64fdbd131bce697b6cf9cd7850ac2d..79f7cac7aacacf3d81e4c999a5c73778eccd7992 100644 (file)
@@ -1,3 +1,8 @@
+2011-09-27  Kai Tietz  <ktietz@redhat.com>
+
+       * config/obj-coff.c (obj_coff_section): Add 'e' as specifier
+       for marking section SEC_EXCLUDE.
+
 2011-09-22  Tristan Gingold  <gingold@adacore.com>
 
        * NEWS: Add marker for 2.22.
index d481026ee9a86978c0ddb16c29625a2e843052ae..a15d3a2d68fe4ba2fcfb2a2f1dbc3b95c40ef69b 100644 (file)
@@ -1531,6 +1531,7 @@ coff_frob_file_after_relocs (void)
                                                  'o' for over
                                                  'w' for data
                                                 'd' (apparently m88k for data)
+                                                'e' for exclude
                                                  'x' for text
                                                 'r' for read-only data
                                                 's' for shared data (PE)
@@ -1598,6 +1599,11 @@ obj_coff_section (int ignore ATTRIBUTE_UNUSED)
                }
              switch (attr)
                {
+               case 'e':
+                 /* Exclude section from linking.  */
+                 flags |= SEC_EXCLUDE;
+                 break;
+
                case 'b':
                  /* Uninitialised data section.  */
                  flags |= SEC_ALLOC;
index 9df84ae0ad7a8b5af9eed488788f109cc82417ba..17c786f0e65dc2e0cd5a58e03d6744e4d4a535f0 100644 (file)
@@ -1,3 +1,9 @@
+2011-09-27  Kai Tietz  <ktietz@redhat.com>
+
+       * gas/pe/pe.exp: Add new testcase.
+       * gas/pe/section-exclude.d: New file.
+       * gas/pe/section-exclude.s: New file.
+
 2011-09-27  David S. Miller  <davem@davemloft.net>
 
        * gas/sparc/hpcvis3.s: Update to use float reg for random insn.
index d5506e9e81a43196ff8f234945ae88762ba4afef..870df11a5ea2775c2ab5526c06d046df23e5d848 100755 (executable)
@@ -35,6 +35,7 @@ run_dump_test "aligncomm-d"
 
 run_dump_test "section-align-1"
 run_dump_test "section-align-3"
+run_dump_test "section-exclude"
 
 # SEH related tests
 
diff --git a/gas/testsuite/gas/pe/section-exclude.d b/gas/testsuite/gas/pe/section-exclude.d
new file mode 100644 (file)
index 0000000..02b3bd5
--- /dev/null
@@ -0,0 +1,20 @@
+#objdump: -h
+#name: section exclude
+
+# Test that 'e' works in .section directives.
+
+.*: .*
+
+Sections:
+Idx Name          *Size      *VMA       *LMA       *File off  *Algn
+  3 .foo1         00000004  0000000000000000  0000000000000000  000000b4  2**2
+                  CONTENTS, EXCLUDE
+  0 \.text         0*0000000  0*0000000  0*0000000  0*0000000  2\*\*[24]
+.*
+  1 \.data         0*0000000  0*0000000  0*0000000  0*0000000  2\*\*[24]
+.*
+  2 \.bss          0*0000000  0*0000000  0*0000000  0*0000000  2\*\*[24]
+.*
+  3 \.foo1         0*0000004  0*0000000  0*0000000  0*0000000  2\*\*[24]
+.*CONTENS, EXCLUDE
+.*
diff --git a/gas/testsuite/gas/pe/section-exclude.s b/gas/testsuite/gas/pe/section-exclude.s
new file mode 100644 (file)
index 0000000..f623846
--- /dev/null
@@ -0,0 +1,2 @@
+       .section .foo1,"e"
+       .byte 0,0,0,0