]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
Backported (actually more-or-less simultaneously applied) from trunk:
authorDave Korn <dave.korn@artimi.com>
Wed, 27 Jan 2010 22:08:24 +0000 (22:08 +0000)
committerDave Korn <dave.korn@artimi.com>
Wed, 27 Jan 2010 22:08:24 +0000 (22:08 +0000)
gas/ChangeLog:

* NEWS: Mention new feature.
* config/obj-coff.c (obj_coff_section): Accept digits and use
to override default section alignment power if specified.
* doc/as.texinfo (.section directive): Update documentation.

gas/testsuite/ChangeLog:

* gas/pe/section-align-1.s: New test source file.
* gas/pe/section-align-1.d: Likewise control script.
* gas/pe/section-align-2.s: Likewise ...
* gas/pe/section-align-2.d: ... and likewise.
* gas/pe/pe.exp: Invoke new testcases.

gas/ChangeLog
gas/NEWS
gas/config/obj-coff.c
gas/doc/as.texinfo
gas/testsuite/ChangeLog
gas/testsuite/gas/pe/pe.exp
gas/testsuite/gas/pe/section-align-1.d
gas/testsuite/gas/pe/section-align-3.d

index 8e3b3d06c9ea3a80141b77a69f0184ecedc5ed7d..9cd161b973881fa2eb83c6b61527111e782fa09a 100644 (file)
@@ -1,3 +1,11 @@
+2010-01-27  Dave Korn  <dave.korn.cygwin@gmail.com>
+
+       Backport from trunk:
+       * NEWS: Mention new feature.
+       * config/obj-coff.c (obj_coff_section): Accept digits and use
+       to override default section alignment power if specified.
+       * doc/as.texinfo (.section directive): Update documentation.
+
 2010-01-21  Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>
 
        * config/te-solaris.h (DWARF2_EH_FRAME_READ_ONLY): Make read-only
index 3fa380952520256608b0c4eb919d880ad9ba48d8..27929c09aa649b6226bcac82479a0f6cba3729d5 100644 (file)
--- a/gas/NEWS
+++ b/gas/NEWS
@@ -1,5 +1,10 @@
 -*- text -*-
 
+Changes in 2.20.1:
+
+* GAS now understands an extended syntax in the .section directive flags
+  for COFF targets that allows the section's alignment to be specified.
+
 Changes in 2.20:
 
 * GNU/Linux targets now supports "gnu_unique_object" as a value in the .type
index 271b01ef3dc3ff3163f4b791ee135de5a169a6f0..8e22279f8be217c0cefbf241f87313f81612bdaa 100644 (file)
@@ -23,6 +23,7 @@
 #define OBJ_HEADER "obj-coff.h"
 
 #include "as.h"
+#include "safe-ctype.h"
 #include "obstack.h"
 #include "subsegs.h"
 
@@ -1543,6 +1544,7 @@ coff_frob_file_after_relocs (void)
                                                 'r' for read-only data
                                                 's' for shared data (PE)
                                                 'y' for noread
+                                          '0' - '9' for power-of-two alignment (GNU extension).
    But if the argument is not a quoted string, treat it as a
    subsegment number.
 
@@ -1555,6 +1557,7 @@ obj_coff_section (int ignore ATTRIBUTE_UNUSED)
   /* Strip out the section name.  */
   char *section_name;
   char c;
+  int alignment = -1;
   char *name;
   unsigned int exp;
   flagword flags, oldflags;
@@ -1597,6 +1600,11 @@ obj_coff_section (int ignore ATTRIBUTE_UNUSED)
                 attr != '"'
                 && ! is_end_of_line[attr])
            {
+             if (ISDIGIT (attr))
+               {
+                 alignment = attr - '0';
+                 continue;
+               }
              switch (attr)
                {
                case 'b':
@@ -1673,6 +1681,8 @@ obj_coff_section (int ignore ATTRIBUTE_UNUSED)
     }
 
   sec = subseg_new (name, (subsegT) exp);
+  if (alignment >= 0)
+    sec->alignment_power = alignment;
 
   oldflags = bfd_get_section_flags (stdoutput, sec);
   if (oldflags == SEC_NO_FLAGS)
index 43fee5fb7b93083e8d51c53e021465d7654c895e..dde2fdb57a0a2159126683a90f9cbc9f9f0d0e63 100644 (file)
@@ -5752,6 +5752,8 @@ shared section (meaningful for PE targets)
 ignored.  (For compatibility with the ELF version)
 @item y
 section is not readable (meaningful for PE targets)
+@item 0-9
+single-digit power-of-two section alignment (GNU extension)
 @end table
 
 If no flags are specified, the default flags depend upon the section name.  If
index 1f73fe0a7b9e878f499ee98df036ca291186f24a..0770a17d7f3eee16c0ff0be7d8db00c2deaf17f4 100644 (file)
@@ -1,3 +1,12 @@
+2010-01-27  Dave Korn  <dave.korn.cygwin@gmail.com>
+
+       Backport from trunk:
+       * gas/pe/section-align-1.s: New test source file.
+       * gas/pe/section-align-1.d: Likewise control script.
+       * gas/pe/section-align-2.s: Likewise ...
+       * gas/pe/section-align-2.d: ... and likewise.
+       * gas/pe/pe.exp: Invoke new testcases.
+
 2009-12-15  H.J. Lu  <hongjiu.lu@intel.com>
 
        Backport from trunk:
index 87e2a3e097a82a7d97eca21f1c7a75a53bc4a0cb..aadf972c7cddfb267bc4334cb34fdd964cf5d90e 100755 (executable)
@@ -32,3 +32,6 @@ run_dump_test "aligncomm-a"
 run_dump_test "aligncomm-b"
 run_dump_test "aligncomm-c"
 run_dump_test "aligncomm-d"
+
+run_dump_test "section-align-1"
+run_dump_test "section-align-3"
index 01fb4715ce23db000c5ef1bd1780a0af38fe9d20..7a50b82ae7f844e7217ab81a3c0b4af2f8718858 100644 (file)
@@ -6,24 +6,24 @@
 .*: .*
 
 Sections:
-Idx Name          *Size      *VMA       *LMA       *File off  *Algn
-  0 \.text         0*0000000  0*0000000  0*0000000  0*0000000  2\*\*[24]
+Idx Name          Size      VMA       LMA       File off  Algn
+  0 \.text         00000000  00000000  00000000  00000000  2\*\*2
                   ALLOC, LOAD, READONLY, CODE
-  1 \.data         0*0000000  0*0000000  0*0000000  0*0000000  2\*\*[24]
+  1 \.data         00000000  00000000  00000000  00000000  2\*\*2
                   ALLOC, LOAD, DATA
-  2 \.bss          0*0000000  0*0000000  0*0000000  0*0000000  2\*\*[24]
+  2 \.bss          00000000  00000000  00000000  00000000  2\*\*2
                   ALLOC
-  3 \.none         0*0000000  0*0000000  0*0000000  0*0000000  2\*\*0
+  3 \.none         00000000  00000000  00000000  00000000  2\*\*0
                   ALLOC, LOAD, READONLY, DATA
-  4 \.zero         0*0000000  0*0000000  0*0000000  0*0000000  2\*\*0
+  4 \.zero         00000000  00000000  00000000  00000000  2\*\*0
                   ALLOC, LOAD, READONLY, DATA
-  5 \.one          0*0000001  0*0000000  0*0000000  0*00001a4  2\*\*0
+  5 \.one          00000001  00000000  00000000  000001a4  2\*\*0
                   CONTENTS, ALLOC, LOAD, READONLY, DATA
-  6 \.two          0*0000002  0*0000000  0*0000000  0*00001a5  2\*\*0
+  6 \.two          00000002  00000000  00000000  000001a5  2\*\*0
                   CONTENTS, ALLOC, LOAD, READONLY, DATA
-  7 \.three        0*0000003  0*0000000  0*0000000  0*00001a7  2\*\*0
+  7 \.three        00000003  00000000  00000000  000001a7  2\*\*0
                   CONTENTS, ALLOC, LOAD, READONLY, DATA
-  8 \.four         0*0000004  0*0000000  0*0000000  0*00001aa  2\*\*0
+  8 \.four         00000004  00000000  00000000  000001aa  2\*\*0
                   CONTENTS, ALLOC, LOAD, READONLY, DATA
-  9 \.five         0*0000005  0*0000000  0*0000000  0*00001ae  2\*\*0
+  9 \.five         00000005  00000000  00000000  000001ae  2\*\*0
                   CONTENTS, ALLOC, LOAD, READONLY, DATA
index 1f37103cdc61e3bcc06e873cc15286fa2bfa1bb8..391e8b328520a058c8312124c2f8a1b9459441c7 100644 (file)
@@ -6,34 +6,34 @@
 .*: .*
 
 Sections:
-Idx Name          *Size      *VMA       *LMA       *File off  *Algn
-  0 \.text         0*0000000  0*0000000  0*0000000  0*0000000  2\*\*[24]
+Idx Name          Size      VMA       LMA       File off  Algn
+  0 \.text         00000000  00000000  00000000  00000000  2\*\*2
                   ALLOC, LOAD, READONLY, CODE
-  1 \.data         0*0000000  0*0000000  0*0000000  0*0000000  2\*\*[24]
+  1 \.data         00000000  00000000  00000000  00000000  2\*\*2
                   ALLOC, LOAD, DATA
-  2 \.bss          0*0000000  0*0000000  0*0000000  0*0000000  2\*\*[24]
+  2 \.bss          00000000  00000000  00000000  00000000  2\*\*2
                   ALLOC
-  3 \.none         0*0000000  0*0000000  0*0000000  0*0000000  2\*\*3
+  3 \.none         00000000  00000000  00000000  00000000  2\*\*3
                   ALLOC, LOAD, READONLY, DATA
-  4 \.zero         0*0000000  0*0000000  0*0000000  0*0000000  2\*\*3
+  4 \.zero         00000000  00000000  00000000  00000000  2\*\*3
                   ALLOC, LOAD, READONLY, DATA
-  5 \.one          0*0000008  0*0000000  0*0000000  0*000026c  2\*\*3
+  5 \.one          00000008  00000000  00000000  0000026c  2\*\*3
                   CONTENTS, ALLOC, LOAD, READONLY, DATA
-  6 \.two          0*0000008  0*0000000  0*0000000  0*0000274  2\*\*3
+  6 \.two          00000008  00000000  00000000  00000274  2\*\*3
                   CONTENTS, ALLOC, LOAD, READONLY, DATA
-  7 \.three        0*0000008  0*0000000  0*0000000  0*000027c  2\*\*3
+  7 \.three        00000008  00000000  00000000  0000027c  2\*\*3
                   CONTENTS, ALLOC, LOAD, READONLY, DATA
-  8 \.four         0*0000008  0*0000000  0*0000000  0*0000284  2\*\*3
+  8 \.four         00000008  00000000  00000000  00000284  2\*\*3
                   CONTENTS, ALLOC, LOAD, READONLY, DATA
-  9 \.five         0*0000008  0*0000000  0*0000000  0*000028c  2\*\*3
+  9 \.five         00000008  00000000  00000000  0000028c  2\*\*3
                   CONTENTS, ALLOC, LOAD, READONLY, DATA
- 10 \.six          0*0000008  0*0000000  0*0000000  0*0000294  2\*\*3
+ 10 \.six          00000008  00000000  00000000  00000294  2\*\*3
                   CONTENTS, ALLOC, LOAD, READONLY, DATA
- 11 \.seven        0*0000008  0*0000000  0*0000000  0*000029c  2\*\*3
+ 11 \.seven        00000008  00000000  00000000  0000029c  2\*\*3
                   CONTENTS, ALLOC, LOAD, READONLY, DATA
- 12 \.eight        0*0000008  0*0000000  0*0000000  0*00002a4  2\*\*3
+ 12 \.eight        00000008  00000000  00000000  000002a4  2\*\*3
                   CONTENTS, ALLOC, LOAD, READONLY, DATA
- 13 \.nine         0*0000010  0*0000000  0*0000000  0*00002ac  2\*\*3
+ 13 \.nine         00000010  00000000  00000000  000002ac  2\*\*3
                   CONTENTS, ALLOC, LOAD, READONLY, DATA
- 14 \.ten          0*0000010  0*0000000  0*0000000  0*00002bc  2\*\*3
+ 14 \.ten          00000010  00000000  00000000  000002bc  2\*\*3
                   CONTENTS, ALLOC, LOAD, READONLY, DATA