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.
This commit is contained in:
Dave Korn
2010-01-27 22:01:38 +00:00
parent 40b27cdc59
commit 31907d5e90
10 changed files with 143 additions and 0 deletions

View File

@ -23,6 +23,7 @@
#define OBJ_HEADER "obj-coff.h"
#include "as.h"
#include "safe-ctype.h"
#include "obstack.h"
#include "subsegs.h"
@ -1540,6 +1541,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.
@ -1552,6 +1554,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;
@ -1594,6 +1597,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':
@ -1670,6 +1678,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)