include
authorDanny Smith <dannysmith@users.sourceforge.net>
Sun, 4 Nov 2007 23:49:09 +0000 (23:49 +0000)
committerDanny Smith <dannysmith@users.sourceforge.net>
Sun, 4 Nov 2007 23:49:09 +0000 (23:49 +0000)
* coff/pe.h (COFF_ENCODE_ALIGNMENT) Define.

gas
* read.c (ALIGN_LIMIT): Rename to ...
(TC_ALIGN_LIMIT): Guard against prior definition.
* config/tc-i386.h (TC_ALIGN_LIMIT)[TE_PE]: Define.

bfd
* pe-i386.c (COFF_SECTION_ALIGNMENT_ENTRIES): Let .data, .text
 and .bss section use the default.
* pei-i386.c (COFF_SECTION_ALIGNMENT_ENTRIES): Likewise.

ld/testsuite
* ld-scripts/align.exp: Enable for PECOFF.
* ld-scripts/alignof.exp: Likewise.

bfd/ChangeLog
bfd/pe-i386.c
gas/ChangeLog
gas/read.c
include/ChangeLog
include/coff/pe.h
ld/testsuite/ChangeLog
ld/testsuite/ld-scripts/align.exp
ld/testsuite/ld-scripts/alignof.exp

index 6c8472625192784a4307a39aef5d57c8be631e15..7f101165870f9f1e5593f7ca6a9136955613d67c 100644 (file)
@@ -1,3 +1,9 @@
+2007-11-05  Danny Smith  <dannysmith@users.sourceforge.net>
+
+       * pe-i386.c (COFF_SECTION_ALIGNMENT_ENTRIES): Let .data, .text
+        and .bss section use the default.
+       * pei-i386.c (COFF_SECTION_ALIGNMENT_ENTRIES): Likewise.
+
 2007-11-01  Joseph Myers  <joseph@codesourcery.com>
 
        * merge.c (sec_merge_hash_lookup): Add parameter sec_end.  Check
index faf8be6a9e65a0a0d7fa7fdb9af7f3596e3fee4e..ec5b43e50567aaf2e227ce2776634787e488cc1c 100644 (file)
 #define COFF_LONG_FILENAMES
 
 #define COFF_SECTION_ALIGNMENT_ENTRIES \
-{ COFF_SECTION_NAME_EXACT_MATCH (".bss"), \
-  COFF_ALIGNMENT_FIELD_EMPTY, COFF_ALIGNMENT_FIELD_EMPTY, 4 }, \
-{ COFF_SECTION_NAME_EXACT_MATCH (".data"), \
-  COFF_ALIGNMENT_FIELD_EMPTY, COFF_ALIGNMENT_FIELD_EMPTY, 4 }, \
-{ COFF_SECTION_NAME_PARTIAL_MATCH (".data$"), \
-  COFF_ALIGNMENT_FIELD_EMPTY, COFF_ALIGNMENT_FIELD_EMPTY, 4 }, \
-{ COFF_SECTION_NAME_EXACT_MATCH (".rdata"), \
-  COFF_ALIGNMENT_FIELD_EMPTY, COFF_ALIGNMENT_FIELD_EMPTY, 4 }, \
-{ COFF_SECTION_NAME_PARTIAL_MATCH (".rdata$"), \
-  COFF_ALIGNMENT_FIELD_EMPTY, COFF_ALIGNMENT_FIELD_EMPTY, 4 }, \
-{ COFF_SECTION_NAME_EXACT_MATCH (".text"), \
-  COFF_ALIGNMENT_FIELD_EMPTY, COFF_ALIGNMENT_FIELD_EMPTY, 4 }, \
-{ COFF_SECTION_NAME_PARTIAL_MATCH (".text$"), \
-  COFF_ALIGNMENT_FIELD_EMPTY, COFF_ALIGNMENT_FIELD_EMPTY, 4 }, \
 { COFF_SECTION_NAME_PARTIAL_MATCH (".idata"), \
   COFF_ALIGNMENT_FIELD_EMPTY, COFF_ALIGNMENT_FIELD_EMPTY, 2 }, \
 { COFF_SECTION_NAME_EXACT_MATCH (".pdata"), \
index 8ec67340f8ae25bd442fcfab29b4b012ec86d81b..637be807f107977be1a211b37ec9b6b25ee5a34a 100644 (file)
@@ -1,3 +1,9 @@
+2007-11-05  Danny Smith  <dannysmith@users.sourceforge.net>
+
+       * read.c (ALIGN_LIMIT): Rename to ...
+       (TC_ALIGN_LIMIT): Guard against prior definition.
+       * config/tc-i386.h (TC_ALIGN_LIMIT)[TE_PE]: Define.
+
 2007-11-01  Sterling Augustine  <sterling@tensilica.com>
 
        * config/tc-xtensa.c (xtensa_symbol_new_hook): New.
index 1162139ca4504777c100de81f340e3ad35486d54..2f3b2383f22f983b1cc30deee2676b755b37acd5 100644 (file)
@@ -1276,13 +1276,14 @@ do_align (int n, char *fill, int len, int max)
    (in bytes).  A negative ARG is the negative of the length of the
    fill pattern.  BYTES_P is non-zero if the alignment value should be
    interpreted as the byte boundary, rather than the power of 2.  */
-
-#define ALIGN_LIMIT (stdoutput->arch_info->bits_per_address - 1)
+#ifndef TC_ALIGN_LIMIT
+#define TC_ALIGN_LIMIT (stdoutput->arch_info->bits_per_address - 1)
+#endif
 
 static void
 s_align (int arg, int bytes_p)
 {
-  unsigned int align_limit = ALIGN_LIMIT;
+  unsigned int align_limit = TC_ALIGN_LIMIT;
   unsigned int align;
   char *stop = NULL;
   char stopc = 0;
index 9dfb1b08a4c1777f697927722d0415518dcd2827..f3dc433342842cac10a6fe394f9c6746ceaf955b 100644 (file)
@@ -1,3 +1,7 @@
+2007-11-05  Danny Smith  <dannysmith@users.sourceforge.net>
+
+       * coff/pe.h (COFF_ENCODE_ALIGNMENT) Define.
+
 2007-09-06  Tom Tromey  <tromey@redhat.com>
 
        * libiberty.h (pex_free): Document process killing.
index 5a4d96027d483472716472c5ac6c7189c95441f0..734b11ab9c70c653caebe61dce20e28dab669e06 100644 (file)
 #define IMAGE_SCN_ALIGN_4096BYTES           IMAGE_SCN_ALIGN_POWER_CONST (12)
 #define IMAGE_SCN_ALIGN_8192BYTES           IMAGE_SCN_ALIGN_POWER_CONST (13)
 
+/* Encode alignment power into IMAGE_SCN_ALIGN bits of s_flags */
+#define COFF_ENCODE_ALIGNMENT(SECTION, ALIGNMENT_POWER) \
+  ((SECTION).s_flags |= IMAGE_SCN_ALIGN_POWER_CONST ((ALIGNMENT_POWER)))
+
 #define IMAGE_SCN_LNK_NRELOC_OVFL            0x01000000  /* Section contains extended relocations. */
 #define IMAGE_SCN_MEM_NOT_CACHED             0x04000000  /* Section is not cachable.               */
 #define IMAGE_SCN_MEM_NOT_PAGED              0x08000000  /* Section is not pageable.               */
index b8b5b2b3e58585eb5c8d6b64fbc82715bfb6d655..0ebc47ee27540a798c2e390642d19697febbb9b5 100644 (file)
@@ -1,3 +1,8 @@
+2007-11-05  Danny Smith  <dannysmith@users.sourceforge.net>
+
+       * ld-scripts/align.exp: Enable for PECOFF.
+       * ld-scripts/alignof.exp: Likewise.
+
 2007-11-01  Joseph Myers  <joseph@codesourcery.com>
 
        * ld-elf/merge3.d, ld-elf/merge3.s: New.
index e666982515479bb86ca488f13ce2069578ae7092..b0fb96299d3f942f41d10d84764be238d269fb1d 100644 (file)
@@ -32,17 +32,11 @@ if ![ld_assemble $as $srcdir/$subdir/align.s tmpdir/align.o] {
     return
 }
 
-# Doesn't work on PECOFF, appears to be a genuine bug.
 # mingw on x86_64 targets need to set the image base to 0 to avoid auto image-basing.
 global LDFLAGS
 set saved_LDFLAGS "$LDFLAGS"
 if [istarget "x86_64-*-mingw*"] then {
   set LDFLAGS "$LDFLAGS --image-base 0"
-} else {
-  if [is_pecoff_format] {
-  global target_triplet
-  setup_xfail $target_triplet
-  }
 }
 
 if ![ld_simple_link $ld tmpdir/align "$LDFLAGS -T $srcdir/$subdir/align.t tmpdir/align.o"] {
index 207d22cb941e9c5c2526ad88d07638fea8811d68..0f05aeb6dfec8599975ecde6b716b1051228e25e 100644 (file)
@@ -19,9 +19,9 @@
 # Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston,
 # MA 02110-1301, USA.
 
-# Only ELF targets record section alignment.
+# Only ELF and PE-COFF targets record section alignment.
 
-if ![is_elf_format] {
+if {![is_elf_format] && ![is_pecoff_format]} {
     return
 }