From: Danny Smith Date: Sun, 4 Nov 2007 23:49:09 +0000 (+0000) Subject: include X-Git-Url: http://git.efficios.com/?a=commitdiff_plain;h=11ec4ba97796b1bdfc68b034ce3f719af81c3e48;p=deliverable%2Fbinutils-gdb.git include * 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. --- diff --git a/bfd/ChangeLog b/bfd/ChangeLog index 6c84726251..7f10116587 100644 --- a/bfd/ChangeLog +++ b/bfd/ChangeLog @@ -1,3 +1,9 @@ +2007-11-05 Danny Smith + + * 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 * merge.c (sec_merge_hash_lookup): Add parameter sec_end. Check diff --git a/bfd/pe-i386.c b/bfd/pe-i386.c index faf8be6a9e..ec5b43e505 100644 --- a/bfd/pe-i386.c +++ b/bfd/pe-i386.c @@ -32,20 +32,6 @@ #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"), \ diff --git a/gas/ChangeLog b/gas/ChangeLog index 8ec67340f8..637be807f1 100644 --- a/gas/ChangeLog +++ b/gas/ChangeLog @@ -1,3 +1,9 @@ +2007-11-05 Danny Smith + + * 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 * config/tc-xtensa.c (xtensa_symbol_new_hook): New. diff --git a/gas/read.c b/gas/read.c index 1162139ca4..2f3b2383f2 100644 --- a/gas/read.c +++ b/gas/read.c @@ -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; diff --git a/include/ChangeLog b/include/ChangeLog index 9dfb1b08a4..f3dc433342 100644 --- a/include/ChangeLog +++ b/include/ChangeLog @@ -1,3 +1,7 @@ +2007-11-05 Danny Smith + + * coff/pe.h (COFF_ENCODE_ALIGNMENT) Define. + 2007-09-06 Tom Tromey * libiberty.h (pex_free): Document process killing. diff --git a/include/coff/pe.h b/include/coff/pe.h index 5a4d96027d..734b11ab9c 100644 --- a/include/coff/pe.h +++ b/include/coff/pe.h @@ -90,6 +90,10 @@ #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. */ diff --git a/ld/testsuite/ChangeLog b/ld/testsuite/ChangeLog index b8b5b2b3e5..0ebc47ee27 100644 --- a/ld/testsuite/ChangeLog +++ b/ld/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2007-11-05 Danny Smith + + * ld-scripts/align.exp: Enable for PECOFF. + * ld-scripts/alignof.exp: Likewise. + 2007-11-01 Joseph Myers * ld-elf/merge3.d, ld-elf/merge3.s: New. diff --git a/ld/testsuite/ld-scripts/align.exp b/ld/testsuite/ld-scripts/align.exp index e666982515..b0fb96299d 100644 --- a/ld/testsuite/ld-scripts/align.exp +++ b/ld/testsuite/ld-scripts/align.exp @@ -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"] { diff --git a/ld/testsuite/ld-scripts/alignof.exp b/ld/testsuite/ld-scripts/alignof.exp index 207d22cb94..0f05aeb6df 100644 --- a/ld/testsuite/ld-scripts/alignof.exp +++ b/ld/testsuite/ld-scripts/alignof.exp @@ -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 }