summaryrefslogtreecommitdiff
path: root/ld/pe-dll.c
diff options
context:
space:
mode:
authorDave Korn <dave.korn@artimi.com>2009-05-19 16:08:08 +0000
committerDave Korn <dave.korn@artimi.com>2009-05-19 16:08:08 +0000
commit0aa31775320139f5b8ce133995cc7be8cb46a31b (patch)
tree95b86da8842f2fef72a6092f20bb3a593bae8707 /ld/pe-dll.c
parent6d35759a5bde65d76ffb82f4503c37093c359382 (diff)
downloadbinutils-redhat-0aa31775320139f5b8ce133995cc7be8cb46a31b.tar.gz
==> bfd/ChangeLog <==
2009-05-19 Dave Korn <dave.korn.cygwin@gmail.com> * cofflink.c (process_embedded_commands): Ignore "-aligncomm". ==> gas/ChangeLog <== 2009-05-19 Dave Korn <dave.korn.cygwin@gmail.com> * NEWS: Mention new feature. * config/obj-coff.c (obj_coff_common_parse): New function. (obj_coff_comm): Likewise. (coff_pseudo_table): Override default ".comm" definition on PE. * doc/as.texinfo: Document new feature. ==> gas/testsuite/ChangeLog <== 2009-05-19 Dave Korn <dave.korn.cygwin@gmail.com> * gas/pe/: New directory for PE format-specific tests. * gas/pe/aligncomm-a.d: New test pattern file. * gas/pe/aligncomm-a.s: New test source file. * gas/pe/aligncomm-b.d: New test pattern file. * gas/pe/aligncomm-b.s: New test source file. * gas/pe/aligncomm-c.d: New test pattern file. * gas/pe/aligncomm-c.s: New test source file. * gas/pe/aligncomm-d.d: New test pattern file. * gas/pe/aligncomm-d.s: New test source file. * gas/pe/pe.exp: New test control script. * lib/gas-defs.exp (is_pecoff_format): New function. ==> ld/ChangeLog <== 2009-05-19 Dave Korn <dave.korn.cygwin@gmail.com> * NEWS: Mention new feature. * deffile.h (def_file_aligncomm): Add new struct definition. (def_file): Add new def_file_aligncomm member. * deffilep.y (%token): Add new ALIGNCOMM token. (command): Add production rule for ALIGNCOMM. (def_file_free): Free any chained def_file_aligncomm structs. (diropts[]): Add entry for '-aligncomm' .drectve command. (def_aligncomm): New grammar function. * ld.texinfo: Document new feature. * pe-dll.c (process_def_file): Rename from this ... (process_def_file_and_drectve): ... to this, updating all callers, and process any aligncomms chained to the def file after scanning all .drectve sections. (generate_edata): Updated to match. (pe_dll_build_sections): Likewise. ==> ld/testsuite/ChangeLog <== 2009-05-19 Dave Korn <dave.korn.cygwin@gmail.com> * ld-pe/aligncomm-1.c: New test source file. * ld-pe/aligncomm-2.c: Likewise. * ld-pe/aligncomm-3.c: Likewise. * ld-pe/aligncomm-4.c: Likewise. * ld-pe/aligncomm.d: New test pattern file. * ld-pe/direct.exp: Deleted, and content moved into ... * ld-pe/pe-run.exp: ... New common file for all PE run tests. * ld-pe/vers-script.exp: Deleted, and content merged into ... * ld-pe/pe-compile.exp: ... New common file for PE tests needing a compiler, adding aligned common tests. * ld-pe/pe.exp: Update header comment.
Diffstat (limited to 'ld/pe-dll.c')
-rw-r--r--ld/pe-dll.c28
1 files changed, 25 insertions, 3 deletions
diff --git a/ld/pe-dll.c b/ld/pe-dll.c
index 3f2815e37a..f615b2d2bf 100644
--- a/ld/pe-dll.c
+++ b/ld/pe-dll.c
@@ -615,7 +615,7 @@ auto_export (bfd *abfd, def_file *d, const char *n)
}
static void
-process_def_file (bfd *abfd ATTRIBUTE_UNUSED, struct bfd_link_info *info)
+process_def_file_and_drectve (bfd *abfd ATTRIBUTE_UNUSED, struct bfd_link_info *info)
{
int i, j;
struct bfd_link_hash_entry *blhe;
@@ -642,6 +642,28 @@ process_def_file (bfd *abfd ATTRIBUTE_UNUSED, struct bfd_link_info *info)
}
}
+ /* Process aligned common symbol information from the
+ .drectve sections now; common symbol allocation is
+ done before final link, so it will be too late to
+ process them in process_embedded_commands() called
+ from _bfd_coff_link_input_bfd(). */
+ if (pe_def_file->aligncomms)
+ {
+ def_file_aligncomm *ac = pe_def_file->aligncomms;
+ while (ac)
+ {
+ struct coff_link_hash_entry *sym_hash;
+ sym_hash = coff_link_hash_lookup (coff_hash_table (info),
+ ac->symbol_name, FALSE, FALSE, FALSE);
+ if (sym_hash && sym_hash->root.type == bfd_link_hash_common
+ && sym_hash->root.u.c.p->alignment_power < (unsigned) ac->alignment)
+ {
+ sym_hash->root.u.c.p->alignment_power = (unsigned) ac->alignment;
+ }
+ ac = ac->next;
+ }
+ }
+
/* If we are not building a DLL, when there are no exports
we do not build an export table at all. */
if (!pe_dll_export_everything && pe_def_file->num_exports == 0
@@ -1057,7 +1079,7 @@ generate_edata (bfd *abfd, struct bfd_link_info *info ATTRIBUTE_UNUSED)
}
/* Fill the exported symbol offsets. The preliminary work has already
- been done in process_def_file(). */
+ been done in process_def_file_and_drectve(). */
static void
fill_exported_offsets (bfd *abfd ATTRIBUTE_UNUSED, struct bfd_link_info *info)
@@ -3066,7 +3088,7 @@ pe_dll_build_sections (bfd *abfd, struct bfd_link_info *info)
{
pe_dll_id_target (bfd_get_target (abfd));
pe_output_file_set_long_section_names (abfd);
- process_def_file (abfd, info);
+ process_def_file_and_drectve (abfd, info);
if (pe_def_file->num_exports == 0 && !info->shared)
return;