apply patch from MArk Elbrecht tpo update comment and copyright
[deliverable/binutils-gdb.git] / ld / mpw-eppcmac.c
index b25b371fe7ab46c4be2a4bbe7bd66c6682b7ffce..ba09a410df22aa4e112926af0125c490f178cbfa 100644 (file)
@@ -1,7 +1,7 @@
 /* This file is is generated by a shell script.  DO NOT EDIT! */
 
 /* AIX emulation code for ppcmacos
-   Copyright (C) 1991, 1993, 1995 Free Software Foundation, Inc.
+   Copyright (C) 1991, 1993, 1995, 1998 Free Software Foundation, Inc.
    Written by Steve Chamberlain <sac@cygnus.com>
    AIX support by Ian Lance Taylor <ian@cygnus.com>
 
@@ -165,6 +165,7 @@ gldppcmacos_parse_args (argc, argv)
     {"bmodtype", required_argument, NULL, OPTION_MODTYPE},
     {"bnoautoimp", no_argument, NULL, OPTION_NOAUTOIMP},
     {"bnodelcsect", no_argument, NULL, OPTION_IGNORE},
+    {"bnoentry", no_argument, NULL, OPTION_IGNORE},
     {"bnogc", no_argument, &gc, 0},
     {"bnso", no_argument, NULL, OPTION_NOAUTOIMP},
     {"bnostrcmpct", no_argument, NULL, OPTION_NOSTRCMPCT},
@@ -228,7 +229,7 @@ gldppcmacos_parse_args (argc, argv)
     case 'D':
       val = strtol (optarg, &end, 0);
       if (*end != '\0')
-       einfo ("%P: warning: ignoring invalid -D number %s\n", optarg);
+       einfo (_("%P: warning: ignoring invalid -D number %s\n"), optarg);
       else if (val != -1)
        lang_section_start (".data", exp_intop (val));
       break;
@@ -237,7 +238,7 @@ gldppcmacos_parse_args (argc, argv)
       val = strtoul (optarg, &end, 0);
       if (*end != '\0'
          || (val & (val - 1)) != 0)
-       einfo ("%P: warning: ignoring invalid -H number %s\n", optarg);
+       einfo (_("%P: warning: ignoring invalid -H number %s\n"), optarg);
       else
        file_align = val;
       break;
@@ -303,7 +304,7 @@ gldppcmacos_parse_args (argc, argv)
     case OPTION_MAXDATA:
       val = strtoul (optarg, &end, 0);
       if (*end != '\0')
-       einfo ("%P: warning: ignoring invalid -bmaxdata number %s\n",
+       einfo (_("%P: warning: ignoring invalid -bmaxdata number %s\n"),
               optarg);
       else
        maxdata = val;
@@ -312,7 +313,7 @@ gldppcmacos_parse_args (argc, argv)
     case OPTION_MAXSTACK:
       val = strtoul (optarg, &end, 0);
       if (*end != '\0')
-       einfo ("%P: warning: ignoring invalid -bmaxstack number %s\n",
+       einfo (_("%P: warning: ignoring invalid -bmaxstack number %s\n"),
               optarg);
       else
        maxstack = val;
@@ -325,7 +326,7 @@ gldppcmacos_parse_args (argc, argv)
          ++optarg;
        }
       if (*optarg == '\0' || optarg[1] == '\0')
-       einfo ("%P: warning: ignoring invalid module type %s\n", optarg);
+       einfo (_("%P: warning: ignoring invalid module type %s\n"), optarg);
       else
        modtype = (*optarg << 8) | optarg[1];
       break;
@@ -335,7 +336,7 @@ gldppcmacos_parse_args (argc, argv)
       break;
 
     case OPTION_NOSTRCMPCT:
-      config.traditional_format = true;
+      link_info.traditional_format = true;
       break;
 
     case OPTION_PD:
@@ -345,7 +346,7 @@ gldppcmacos_parse_args (argc, argv)
          expression.  */
       val = strtoul (optarg, &end, 0);
       if (*end != '\0')
-       einfo ("%P: warning: ignoring invalid -pD number %s\n", optarg);
+       einfo (_("%P: warning: ignoring invalid -pD number %s\n"), optarg);
       else
        {
          etree_type *t;
@@ -368,7 +369,7 @@ gldppcmacos_parse_args (argc, argv)
          within the file.  */
       val = strtoul (optarg, &end, 0);
       if (*end != '\0')
-       einfo ("%P: warning: ignoring invalid -pT number %s\n", optarg);
+       einfo (_("%P: warning: ignoring invalid -pT number %s\n"), optarg);
       else
        {
          etree_type *t;
@@ -384,7 +385,7 @@ gldppcmacos_parse_args (argc, argv)
       break;
 
     case OPTION_STRCMPCT:
-      config.traditional_format = false;
+      link_info.traditional_format = false;
       break;
 
     case OPTION_UNIX:
@@ -395,6 +396,45 @@ gldppcmacos_parse_args (argc, argv)
   return 1;
 }
 
+/* This is called when an input file can not be recognized as a BFD
+   object or an archive.  If the file starts with #!, we must treat it
+   as an import file.  This is for AIX compatibility.  */
+
+static boolean
+gldppcmacos_unrecognized_file (entry)
+     lang_input_statement_type *entry;
+{
+  FILE *e;
+  boolean ret;
+
+  e = fopen (entry->filename, FOPEN_RT);
+  if (e == NULL)
+    return false;
+
+  ret = false;
+
+  if (getc (e) == '#' && getc (e) == '!')
+    {
+      struct filelist *n;
+      struct filelist **flpp;
+
+      n = (struct filelist *) xmalloc (sizeof (struct filelist));
+      n->next = NULL;
+      n->name = entry->filename;
+      flpp = &import_files;
+      while (*flpp != NULL)
+       flpp = &(*flpp)->next;
+      *flpp = n;
+
+      ret = true;
+      entry->loaded = true;
+    }
+
+  fclose (e);
+
+  return ret;
+}
+
 /* This is called after the input files have been opened.  */
 
 static void
@@ -406,9 +446,11 @@ gldppcmacos_after_open ()
   /* Call ldctor_build_sets, after pretending that this is a
      relocateable link.  We do this because AIX requires relocation
      entries for all references to symbols, even in a final
-     executable.  */
+     executable.  Of course, we only want to do this if we are
+     producing an XCOFF output file.  */
   r = link_info.relocateable;
-  link_info.relocateable = true;
+  if (strstr (bfd_get_target (output_bfd), "xcoff") != NULL)
+    link_info.relocateable = true;
   ldctor_build_sets ();
   link_info.relocateable = r;
 
@@ -433,7 +475,7 @@ gldppcmacos_after_open ()
 
       size = (p->count + 2) * 4;
       if (! bfd_xcoff_link_record_set (output_bfd, &link_info, p->h, size))
-       einfo ("%F%P: bfd_xcoff_link_record_set failed: %E\n");
+       einfo (_("%F%P: bfd_xcoff_link_record_set failed: %E\n"));
     }
 }
 
@@ -446,7 +488,6 @@ gldppcmacos_before_allocation ()
   struct filelist *fl;
   struct export_symbol_list *el;
   char *libpath;
-  boolean export_defineds;
   asection *special_sections[6];
   int i;
 
@@ -459,9 +500,9 @@ gldppcmacos_before_allocation ()
 
       h = bfd_link_hash_lookup (link_info.hash, el->name, false, false, false);
       if (h == NULL)
-       einfo ("%P%F: bfd_link_hash_lookup of export symbol failed: %E\n");
+       einfo (_("%P%F: bfd_link_hash_lookup of export symbol failed: %E\n"));
       if (! bfd_xcoff_export_symbol (output_bfd, &link_info, h, el->syscall))
-       einfo ("%P%F: bfd_xcoff_export_symbol failed: %E\n");
+       einfo (_("%P%F: bfd_xcoff_export_symbol failed: %E\n"));
     }
 
   /* Track down all relocations called for by the linker script (these
@@ -497,12 +538,6 @@ gldppcmacos_before_allocation ()
        }
     }
 
-  /* If we are emulating the Unix linker, we want to export all
-     defined symbols, unless an explicit -bE option was used.  */
-  export_defineds = false;
-  if (unix_ld && export_symbols == NULL)
-    export_defineds = true;
-
   /* Let the XCOFF backend set up the .loader section.  */
   if (! bfd_xcoff_size_dynamic_sections (output_bfd, &link_info, libpath,
                                         entry_symbol, file_align,
@@ -510,9 +545,9 @@ gldppcmacos_before_allocation ()
                                         gc && ! unix_ld ? true : false,
                                         modtype,
                                         textro ? true : false,
-                                        export_defineds,
+                                        unix_ld,
                                         special_sections))
-    einfo ("%P%F: failed to set dynamic section sizes: %E\n");
+    einfo (_("%P%F: failed to set dynamic section sizes: %E\n"));
 
   /* Look through the special sections, and put them in the right
      place in the link ordering.  This is especially magic.  */
@@ -534,7 +569,7 @@ gldppcmacos_before_allocation ()
       is = NULL;
       os = lang_output_section_find (sec->output_section->name);
       if (os == NULL)
-       einfo ("%P%F: can't find output section %s\n",
+       einfo (_("%P%F: can't find output section %s\n"),
               sec->output_section->name);
       for (pls = &os->children.head; *pls != NULL; pls = &(*pls)->next)
        {
@@ -567,7 +602,7 @@ gldppcmacos_before_allocation ()
        }       
 
       if (is == NULL)
-       einfo ("%P%F: can't find %s in output section\n",
+       einfo (_("%P%F: can't find %s in output section\n"),
               bfd_get_section_name (sec->owner, sec));
 
       /* Now figure out where the section should go.  */
@@ -640,7 +675,7 @@ gldppcmacos_read_file (filename, import)
   o = (struct obstack *) xmalloc (sizeof (struct obstack));
   obstack_specify_allocation (o, 0, 0, xmalloc, gldppcmacos_free);
 
-  f = fopen (filename, "r");
+  f = fopen (filename, FOPEN_RT);
   if (f == NULL)
     {
       bfd_set_error (bfd_error_system_call);
@@ -696,7 +731,7 @@ gldppcmacos_read_file (filename, import)
              obstack_free (o, obstack_base (o));
            }
          else if (*s == '(')
-           einfo ("%F%s%d: #! ([member]) is not supported in import files",
+           einfo (_("%F%s%d: #! ([member]) is not supported in import files\n"),
                   filename, lineno);
          else
            {
@@ -706,7 +741,7 @@ gldppcmacos_read_file (filename, import)
              (void) obstack_finish (o);
              keep = true;
              imppath = s;
-             impfile = NULL;
+             file = NULL;
              while (! isspace ((unsigned char) *s) && *s != '(' && *s != '\0')
                {
                  if (*s == '/')
@@ -736,7 +771,7 @@ gldppcmacos_read_file (filename, import)
                {
                  impmember = "";
                  if (cs != '\0')
-                   einfo ("%s:%d: warning: syntax error in import file\n",
+                   einfo (_("%s:%d: warning: syntax error in import file\n"),
                           filename, lineno);
                }
              else
@@ -748,7 +783,7 @@ gldppcmacos_read_file (filename, import)
                  if (*s == ')')
                    *s = '\0';
                  else
-                   einfo ("%s:%d: warning: syntax error in import file\n",
+                   einfo (_("%s:%d: warning: syntax error in import file\n"),
                           filename, lineno);
                }
            }
@@ -781,7 +816,7 @@ gldppcmacos_read_file (filename, import)
              while (isspace ((unsigned char) *se))
                ++se;
              if (*se != '\0')
-               einfo ("%s%d: warning: syntax error in import/export file\n",
+               einfo (_("%s%d: warning: syntax error in import/export file\n"),
                       filename, lineno);
            }
 
@@ -794,7 +829,7 @@ gldppcmacos_read_file (filename, import)
 
              address = strtoul (s, &end, 0);
              if (*end != '\0')
-               einfo ("%s:%d: warning: syntax error in import/export file\n",
+               einfo (_("%s:%d: warning: syntax error in import/export file\n"),
                       filename, lineno);
            }
        }
@@ -825,7 +860,7 @@ gldppcmacos_read_file (filename, import)
              if (! bfd_xcoff_import_symbol (output_bfd, &link_info, h,
                                             address, imppath, impfile,
                                             impmember))
-               einfo ("%X%s:%d: failed to import symbol %s: %E\n",
+               einfo (_("%X%s:%d: failed to import symbol %s: %E\n"),
                       filename, lineno, symname);
            }
        }
@@ -835,7 +870,7 @@ gldppcmacos_read_file (filename, import)
 
   if (obstack_object_size (o) > 0)
     {
-      einfo ("%s:%d: warning: ignoring unterminated last line\n",
+      einfo (_("%s:%d: warning: ignoring unterminated last line\n"),
             filename, lineno);
       obstack_free (o, obstack_base (o));
     }
@@ -870,9 +905,9 @@ gldppcmacos_find_relocs (s)
 
       rs = &s->reloc_statement;
       if (rs->name == NULL)
-       einfo ("%F%P: only relocations against symbols are permitted\n");
+       einfo (_("%F%P: only relocations against symbols are permitted\n"));
       if (! bfd_xcoff_link_count_reloc (output_bfd, &link_info, rs->name))
-       einfo ("%F%P: bfd_xcoff_link_count_reloc failed: %E\n");
+       einfo (_("%F%P: bfd_xcoff_link_count_reloc failed: %E\n"));
     }
 
   if (s->header.type == lang_assignment_statement_enum)
@@ -900,7 +935,7 @@ gldppcmacos_find_exp_assignment (exp)
        {
          if (! bfd_xcoff_record_link_assignment (output_bfd, &link_info,
                                                  exp->assign.dst))
-           einfo ("%P%F: failed to record assignment to %s: %E\n",
+           einfo (_("%P%F: failed to record assignment to %s: %E\n"),
                   exp->assign.dst);
        }
       gldppcmacos_find_exp_assignment (exp->assign.src);
@@ -1185,4 +1220,5 @@ struct ld_emulation_xfer_struct ld_ppcmacos_emulation =
   0,   /* place_orphan */
   0,   /* set_symbols */
   gldppcmacos_parse_args,
+  gldppcmacos_unrecognized_file
 };
This page took 0.029318 seconds and 4 git commands to generate.