+2001-12-02 Tom Rix <trix@redhat.com>
+
+ * configure.tgt : Remove eaixppc64 emulations.
+ * Makefile.in : Remove eaixppc64.c
+ * ldemul.c (ldemul_choose_target): New parameters argc, argv.
+ (ldemul_default_target): Same.
+ * emultempl/gld960.em (gld960_choose_target): Same.
+ * emultempl/gld960c.em (gld960_choose_target): Same.
+ * scripttempl/aix.sc: Remove OUTPUT_FORMAT.
+ * emultempl/aix.em (is_syscall): syscall_mask now a variable.
+ * emultempl/aix.em (gld*_read_file): symbol_mode_mask now a variable.
+ * emultempl/aix.em (gld*_parse_args): Handle -b32 -b64 emulation.
+ * emultempl/aix.em (choose_target): New function. Handle emulation of
+ -b32 and -b64.
+
2001-11-27 H.J. Lu <hjl@gnu.org>
* emulparams/elf_i386.sh (NO_SMALL_DATA): Set to yes.
emmo.o \
eelf64ppc.o \
eelf64lppc.o \
- eaixppc64.o \
ehppa64linux.o
ea29k.c: $(srcdir)/emulparams/a29k.sh \
$(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/a29k.sc ${GEN_DEPENDS}
${GENSCRIPTS} a29k "$(tdir_a29k)"
-eaixppc64.c: $(srcdir)/emulparams/aixppc64.sh \
- $(srcdir)/emultempl/aix.em $(srcdir)/scripttempl/aix.sc ${GEN_DEPENDS}
- ${GENSCRIPTS} aixppc64 "$(tdir_aixppc64)"
eaixppc.c: $(srcdir)/emulparams/aixppc.sh \
$(srcdir)/emultempl/aix.em $(srcdir)/scripttempl/aix.sc ${GEN_DEPENDS}
${GENSCRIPTS} aixppc "$(tdir_aixppc)"
powerpcle-*-pe) targ_emul=ppcpe ;;
powerpcle-*-winnt*) targ_emul=ppcpe ;;
powerpcle-*-cygwin*) targ_emul=ppcpe ;;
-
-powerpc-*-aix*) targ_emul=aixppc
- targ_extra_emuls="aixppc64"
- tdir_aixppc64=${targ_alias}
- ;;
+powerpc-*-aix*) targ_emul=aixppc ;;
powerpc-*-beos*) targ_emul=aixppc ;;
rs6000-*-aix*) targ_emul=aixrs6 ;;
tic30-*-*aout*) targ_emul=tic30aout ;;
static void gld${EMULATION_NAME}_before_parse PARAMS ((void));
static int gld${EMULATION_NAME}_parse_args PARAMS ((int, char **));
static void gld${EMULATION_NAME}_after_open PARAMS ((void));
+static char * choose_target PARAMS ((int, char **));
static void gld${EMULATION_NAME}_before_allocation PARAMS ((void));
static void gld${EMULATION_NAME}_read_file PARAMS ((const char *, boolean));
static void gld${EMULATION_NAME}_free PARAMS ((PTR));
/* Maintains the 32 or 64 bit mode state of import file */
static unsigned int symbol_mode = 0x04;
+/* Which symbol modes are valid */
+static unsigned int symbol_mode_mask = 0x0d;
+
+/* Whether this is a 64 bit link */
+static int is_64bit = 0;
+
+/* Which syscalls from import file are valid */
+static unsigned int syscall_mask = 0x77;
+
/* This routine is called before anything else is done. */
static void
OPTION_PD,
OPTION_PT,
OPTION_STRCMPCT,
- OPTION_UNIX
+ OPTION_UNIX,
+ OPTION_32,
+ OPTION_64,
};
/*
- b64 is an empty option. The native linker uses -b64 for xcoff64 support
- Our linker uses -m aixppc64 for xcoff64 support. The choice for the
- correct emulation is done in collect2.c via the environmental varible
- LDEMULATION.
-
binitfini has special handling in the linker backend. The native linker
uses the arguemnts to generate a table of init and fini functions for
the executable. The important use for this option is to support aix 4.2+
{"bso", no_argument, NULL, OPTION_AUTOIMP},
{"bstrcmpct", no_argument, NULL, OPTION_STRCMPCT},
{"btextro", no_argument, &textro, 1},
- {"b64", no_argument, NULL, 0},
+ {"b32", no_argument, NULL, OPTION_32},
+ {"b64", no_argument, NULL, OPTION_64},
{"static", no_argument, NULL, OPTION_NOAUTOIMP},
{"unix", no_argument, NULL, OPTION_UNIX},
{NULL, no_argument, NULL, 0}
case OPTION_UNIX:
unix_ld = true;
break;
+
+ case OPTION_32:
+ is_64bit = 0;
+ syscall_mask = 0x77;
+ symbol_mode_mask = 0x0d;
+ break;
+
+ case OPTION_64:
+ is_64bit = 1;
+ syscall_mask = 0xcc;
+ symbol_mode_mask = 0x0e;
+ break;
+
}
return 1;
}
}
+static char *
+choose_target (argc, argv)
+ int argc;
+ char **argv;
+{
+ int i, j, jmax;
+ static char *from_outside;
+ static char *from_inside;
+ static char *argv_to_target[][2] =
+ {
+ NULL, "aixcoff-rs6000",
+ "-b32", "aixcoff-rs6000",
+ "-b64", "aixcoff64-rs6000",
+ };
+
+ jmax = 3;
+
+ from_outside = getenv (TARGET_ENVIRON);
+ if (from_outside != (char *)NULL)
+ return from_outside;
+
+ /* Set to default. */
+ from_inside = argv_to_target[0][1];
+ for (i = 1; i < argc; i++)
+ {
+ for (j = 1; j < jmax; j++)
+ {
+ if (0 == strcmp (argv[i], argv_to_target[j][0]))
+ from_inside = argv_to_target[j][1];
+ }
+ }
+
+ return from_inside;
+}
+
+
static int change_symbol_mode (char *input)
{
/*
}
if (0 == strcmp(input, string)) {
- if (1 << bit & ${SYSCALL_MASK}) {
+ if (1 << bit & syscall_mask) {
*flag = s[bit].flag;
return 1;
} else {
continue;
}
- if (symbol_mode & ${SYMBOL_MODE_MASK})
+ if (symbol_mode & symbol_mode_mask)
{
/* This is a symbol to be imported or exported. */
symname = s;
gld${EMULATION_NAME}_after_open,
after_allocation_default,
set_output_arch_default,
- ldemul_default_target,
+ choose_target,
gld${EMULATION_NAME}_before_allocation,
gld${EMULATION_NAME}_get_script,
"${EMULATION_NAME}",
#include "ldemul.h"
static void gld960_before_parse PARAMS ((void));
-static char *gld960_choose_target PARAMS ((void));
+static char *gld960_choose_target PARAMS ((int, char **));
static void gld960_set_output_arch PARAMS ((void));
static char *gld960_get_script PARAMS ((int *));
}
static char *
-gld960_choose_target()
+gld960_choose_target (argc, argv)
+ int argc ATTRIBUTE_UNUSED;
+ char **argv ATTRIBUTE_UNUSED;
{
#ifdef GNU960
static void gld960_before_parse PARAMS ((void));
static void gld960_set_output_arch PARAMS ((void));
-static char *gld960_choose_target PARAMS ((void));
+static char *gld960_choose_target PARAMS ((int, char **));
static char *gld960_get_script PARAMS ((int *));
#ifdef GNU960
}
static char *
-gld960_choose_target()
+gld960_choose_target (argc, argv)
+ int argc ATTRIBUTE_UNUSED;
+ char **argv ATTRIBUTE_UNUSED;
{
#ifdef GNU960
}
char *
-ldemul_choose_target ()
+ldemul_choose_target (argc, argv)
+ int argc;
+ char **argv;
{
- return ld_emulation->choose_target ();
+ return ld_emulation->choose_target (argc, argv);
}
+
/* The default choose_target function. */
char *
-ldemul_default_target ()
+ldemul_default_target (argc, argv)
+ int argc ATTRIBUTE_UNUSED;
+ char **argv ATTRIBUTE_UNUSED;
{
char *from_outside = getenv (TARGET_ENVIRON);
if (from_outside != (char *) NULL)
extern void ldemul_after_allocation PARAMS ((void));
extern void ldemul_before_allocation PARAMS ((void));
extern void ldemul_set_output_arch PARAMS ((void));
-extern char *ldemul_choose_target PARAMS ((void));
+extern char *ldemul_choose_target PARAMS ((int, char**));
extern void ldemul_choose_mode PARAMS ((char *));
extern void ldemul_list_emulations PARAMS ((FILE *));
extern void ldemul_list_emulation_options PARAMS ((FILE *));
extern boolean ldemul_open_dynamic_archive
PARAMS ((const char *, struct search_dirs *,
struct lang_input_statement_struct *));
-extern char *ldemul_default_target PARAMS ((void));
+extern char *ldemul_default_target PARAMS ((int, char**));
extern void after_parse_default PARAMS ((void));
extern void after_open_default PARAMS ((void));
extern void after_allocation_default PARAMS ((void));
void (*set_output_arch) PARAMS ((void));
/* Decide which target name to use. */
- char * (*choose_target) PARAMS ((void));
+ char * (*choose_target) PARAMS ((int, char**));
/* Run before allocating output sections. */
void (*before_allocation) PARAMS ((void));
emulation = get_emulation (argc, argv);
ldemul_choose_mode (emulation);
- default_target = ldemul_choose_target ();
+ default_target = ldemul_choose_target (argc, argv);
lang_init ();
ldemul_before_parse ();
lang_has_input_file = false;
# AIX always uses shared libraries. The section VMA appears to be
# unimportant. The native linker aligns the sections on boundaries
# specified by the -H option.
+
cat <<EOF
-OUTPUT_FORMAT("${OUTPUT_FORMAT}")
OUTPUT_ARCH(${ARCH})
${RELOCATING+${LIB_SEARCH_DIRS}}
ENTRY(__start)