/* 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 1991, 1993, 1995, 1996, 1997, 2000
+ Free Software Foundation, Inc.
Written by Steve Chamberlain <sac@cygnus.com>
AIX support by Ian Lance Taylor <ian@cygnus.com>
#include "ld.h"
#include "ldmain.h"
-#include "ldemul.h"
-#include "ldfile.h"
#include "ldmisc.h"
#include "ldexp.h"
#include "ldlang.h"
#include "ldctor.h"
#include "ldgram.h"
+#include "ldfile.h"
+#include "ldemul.h"
static void gldppcmacos_before_parse PARAMS ((void));
static int gldppcmacos_parse_args PARAMS ((int, char **));
{"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},
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;
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;
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;
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;
++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;
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;
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;
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
/* 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;
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"));
}
}
struct filelist *fl;
struct export_symbol_list *el;
char *libpath;
- boolean export_defineds;
asection *special_sections[6];
int i;
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
}
}
- /* 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,
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. */
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)
{
}
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. */
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);
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
{
(void) obstack_finish (o);
keep = true;
imppath = s;
- impfile = NULL;
+ file = NULL;
while (! isspace ((unsigned char) *s) && *s != '(' && *s != '\0')
{
if (*s == '/')
{
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
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);
}
}
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);
}
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);
}
}
n = ((struct export_symbol_list *)
xmalloc (sizeof (struct export_symbol_list)));
n->next = export_symbols;
- n->name = buystring (symname);
+ n->name = xstrdup (symname);
n->syscall = syscall;
export_symbols = n;
}
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);
}
}
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));
}
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)
{
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);
0, /* place_orphan */
0, /* set_symbols */
gldppcmacos_parse_args,
+ gldppcmacos_unrecognized_file
};