* emultempl/hppaelf.em (build_section_lists): New function.
[deliverable/binutils-gdb.git] / ld / emultempl / sunos.em
index c98d87e1f7660c43da3f91fabb241999db952a4a..17cd40787ce5f9fb3e7233957bfb6c648e895997 100644 (file)
@@ -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! */
 
@@ -27,12 +32,11 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
 
 #define TARGET_IS_${EMULATION_NAME}
 
-#include <ctype.h>
-
 #include "bfd.h"
 #include "sysdep.h"
 #include "bfdlink.h"
 #include "libiberty.h"
+#include "safe-ctype.h"
 
 #include "ld.h"
 #include "ldmain.h"
@@ -85,7 +89,15 @@ static char *gld${EMULATION_NAME}_get_script PARAMS ((int *isfile));
 static void
 gld${EMULATION_NAME}_before_parse()
 {
-  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};
   config.dynamic_link = true;
   config.has_shared = true;
 }
@@ -298,13 +310,13 @@ gld${EMULATION_NAME}_search_dir (dirname, filename, found_static)
       if (entry->d_name[6 + len] == '\0')
        ;
       else if (entry->d_name[6 + len] == '.'
-              && isdigit ((unsigned char) entry->d_name[7 + len]))
+              && ISDIGIT (entry->d_name[7 + len]))
        ;
       else
        continue;
 
       for (s = entry->d_name + 6 + len; *s != '\0'; s++)
-       if (*s != '.' && ! isdigit ((unsigned char) *s))
+       if (*s != '.' && ! ISDIGIT (*s))
          break;
       if (*s != '\0')
        continue;
This page took 0.02319 seconds and 4 git commands to generate.