This commit was generated by cvs2svn to track changes on a CVS vendor
[deliverable/binutils-gdb.git] / ld / emultempl / armelf.em
index 6e3cfa6fe86f985463f97443dc246e61b6f7a030..583850dac7d20d930128ac090e8cbe3ed5d03db9 100644 (file)
@@ -308,13 +308,25 @@ gld${EMULATION_NAME}_after_open ()
 {
   struct bfd_link_needed_list *needed, *l;
 
-  LANG_FOR_EACH_INPUT_STATEMENT (is)
+  if (strstr (bfd_get_target (output_bfd), "arm") == NULL)
     {
-      /* The interworking bfd must be the last one to be processed */
-      if (!is->next)
-         bfd_elf32_arm_get_bfd_for_interworking (is->the_bfd, & link_info);
+      /* The arm backend needs special fields in the output hash structure.
+        These will only be created if the output format is an arm format,
+        hence we do not support linking and changing output formats at the
+        same time.  Use a link followed by objcopy to change output formats.  */
+      einfo ("%F%X%P: error: cannot change output format whilst linking ARM binaries\n");
+      return;
     }
 
+  {
+    LANG_FOR_EACH_INPUT_STATEMENT (is)
+      {
+       /* The interworking bfd must be the last one to be processed */
+       if (!is->next)
+         bfd_elf32_arm_get_bfd_for_interworking (is->the_bfd, & link_info);
+      }
+  }
+
   /* We only need to worry about this when doing a final link.  */
   if (link_info.relocateable || link_info.shared)
     return;
@@ -1199,7 +1211,7 @@ then
 # Scripts compiled in.
 
 # sed commands to quote an ld script as a C string.
-sc="-f ${srcdir}/emultempl/stringify.sed"
+sc="-f stringify.sed"
 
 cat >>e${EMULATION_NAME}.c <<EOF
 {                           
@@ -1215,6 +1227,10 @@ echo '  ; else if (!config.text_read_only) return'         >> e${EMULATION_NAME}
 sed $sc ldscripts/${EMULATION_NAME}.xbn                    >> e${EMULATION_NAME}.c
 echo '  ; else if (!config.magic_demand_paged) return'     >> e${EMULATION_NAME}.c
 sed $sc ldscripts/${EMULATION_NAME}.xn                     >> e${EMULATION_NAME}.c
+if test -n "$GENERATE_SHLIB_SCRIPT" ; then
+        echo '  ; else if (link_info.shared) return'       >> e${EMULATION_NAME}.c
+        sed $sc ldscripts/${EMULATION_NAME}.xs             >> e${EMULATION_NAME}.c
+fi
 echo '  ; else return'                                     >> e${EMULATION_NAME}.c
 sed $sc ldscripts/${EMULATION_NAME}.x                      >> e${EMULATION_NAME}.c
 echo '; }'                                                 >> e${EMULATION_NAME}.c
@@ -1234,6 +1250,8 @@ cat >>e${EMULATION_NAME}.c <<EOF
     return "ldscripts/${EMULATION_NAME}.xbn";
   else if (!config.magic_demand_paged)
     return "ldscripts/${EMULATION_NAME}.xn";
+  else if (link_info.shared)
+    return "ldscripts/${EMULATION_NAME}.xs";
   else
     return "ldscripts/${EMULATION_NAME}.x";
 }
This page took 0.024468 seconds and 4 git commands to generate.