From d42799374f405007da9e7d9e42e34d8d28dac63f Mon Sep 17 00:00:00 2001 From: Steve Chamberlain Date: Fri, 5 Jan 1996 22:09:43 +0000 Subject: * emultempl/pe.em (gld_${EMULATION_NAME}_before_allocation): sort using right pointer. --- ld/ChangeLog | 11 +++++++++++ ld/emultempl/pe.em | 21 +++++++++++++++++++-- 2 files changed, 30 insertions(+), 2 deletions(-) (limited to 'ld') diff --git a/ld/ChangeLog b/ld/ChangeLog index 3e30e9a..7072300 100644 --- a/ld/ChangeLog +++ b/ld/ChangeLog @@ -1,3 +1,8 @@ +Fri Jan 5 14:07:45 1996 Steve Chamberlain + + * emultempl/pe.em (gld_${EMULATION_NAME}_before_allocation): + sort using right pointer. + Fri Jan 5 12:25:47 1996 Michael Meissner * scripttempl/elfppc.sc: Remove support for creating special @@ -68,6 +73,12 @@ Wed Dec 6 14:59:06 1995 Ian Lance Taylor * ldexp.c (exp_fold_tree): Permit assignments to dot in the final phase if the current section is abs_output_section. + +Tue Dec 5 09:49:39 1995 Doug Evans + + * emultempl/pe.em (gld_${EMULATION_NAME}_before_allocation): Fix call + to sort_sections. + Fri Dec 1 16:48:36 1995 Ian Lance Taylor * ldgram.y (PHDRS): New token. diff --git a/ld/emultempl/pe.em b/ld/emultempl/pe.em index 4fa9fad..40030a7 100644 --- a/ld/emultempl/pe.em +++ b/ld/emultempl/pe.em @@ -44,6 +44,8 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "coff/internal.h" #include "../bfd/libcoff.h" +#define TARGET_IS_${EMULATION_NAME} + static void gld_${EMULATION_NAME}_before_parse PARAMS ((void)); static char *gld_${EMULATION_NAME}_get_script PARAMS ((int *isfile)); @@ -253,7 +255,7 @@ gld_${EMULATION_NAME}_parse_args(argc, argv) return 0; case OPTION_BASE_FILE: - link_info.base_file = (PTR) fopen (optarg,"w"); + link_info.base_file = (PTR) fopen (optarg, FOPEN_WB); if (link_info.base_file == NULL) { fprintf (stderr, "%s: Can't open base file %s\n", @@ -319,9 +321,10 @@ gld_${EMULATION_NAME}_set_symbols() ? NT_DLL_IMAGE_BASE : NT_EXE_IMAGE_BASE; /* Glue the assignments into the abs section */ - save=stat_ptr; + save = stat_ptr; stat_ptr = &(abs_output_section->children); + for (j = 0; init[j].ptr; j++) { long val = init[j].value; @@ -444,6 +447,20 @@ static void gld_${EMULATION_NAME}_before_allocation() { extern lang_statement_list_type *stat_ptr; + +#ifdef TARGET_IS_ppcpe + /* Here we rummage through the found bfds to collect toc information */ + { + LANG_FOR_EACH_INPUT_STATEMENT (is) + { + ppc_process_before_allocation(is->the_bfd, &link_info); + } + } + + /* We have seen it all. Allocate it, and carry on */ + ppc_allocate_toc_section (&link_info); +#endif + sort_sections (*stat_ptr); } -- cgit v1.1