* emultempl/pe.em (gld_${EMULATION_NAME}_before_allocation):
authorSteve Chamberlain <sac@cygnus>
Fri, 5 Jan 1996 22:09:43 +0000 (22:09 +0000)
committerSteve Chamberlain <sac@cygnus>
Fri, 5 Jan 1996 22:09:43 +0000 (22:09 +0000)
sort using right pointer.

ld/ChangeLog
ld/emultempl/pe.em

index 3e30e9a..7072300 100644 (file)
@@ -1,3 +1,8 @@
+Fri Jan  5 14:07:45 1996  Steve Chamberlain  <sac@slash.cygnus.com>
+
+       * emultempl/pe.em (gld_${EMULATION_NAME}_before_allocation):
+       sort using right pointer.
+
 Fri Jan  5 12:25:47 1996  Michael Meissner  <meissner@tiktok.cygnus.com>
 
        * scripttempl/elfppc.sc: Remove support for creating special
@@ -68,6 +73,12 @@ Wed Dec  6 14:59:06 1995  Ian Lance Taylor  <ian@cygnus.com>
        * 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  <dje@canuck.cygnus.com>
+
+       * emultempl/pe.em (gld_${EMULATION_NAME}_before_allocation): Fix call
+       to sort_sections.
+
 Fri Dec  1 16:48:36 1995  Ian Lance Taylor  <ian@cygnus.com>
 
        * ldgram.y (PHDRS): New token.
index 4fa9fad..40030a7 100644 (file)
@@ -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);
 }