summaryrefslogtreecommitdiff
path: root/ld/emultempl/aix.em
diff options
context:
space:
mode:
Diffstat (limited to 'ld/emultempl/aix.em')
-rw-r--r--ld/emultempl/aix.em15
1 files changed, 14 insertions, 1 deletions
diff --git a/ld/emultempl/aix.em b/ld/emultempl/aix.em
index 88d13b29c7..b88960ceb4 100644
--- a/ld/emultempl/aix.em
+++ b/ld/emultempl/aix.em
@@ -1,5 +1,10 @@
# This shell script emits a C file. -*- C -*-
# It does some substitutions.
+if [ -z "$MACHINE" ]; then
+ OUTPUT_ARCH=${ARCH}
+else
+ OUTPUT_ARCH=${ARCH}:${MACHINE}
+fi
cat >e${EMULATION_NAME}.c <<EOF
/* This file is is generated by a shell script. DO NOT EDIT! */
@@ -114,7 +119,15 @@ static void
gld${EMULATION_NAME}_before_parse()
{
#ifndef TARGET_ /* I.e., if not generic. */
- ldfile_output_architecture = bfd_arch_${ARCH};
+ const bfd_arch_info_type *arch = bfd_scan_arch ("${OUTPUT_ARCH}");
+ if (arch)
+ {
+ ldfile_output_architecture = arch->arch;
+ ldfile_output_machine = arch->mach;
+ ldfile_output_machine_name = arch->printable_name;
+ }
+ else
+ ldfile_output_architecture = bfd_arch_${ARCH};
#endif /* not TARGET_ */
config.has_shared = true;