Abort if input format is ARM and output format is not
authorNick Clifton <nickc@redhat.com>
Mon, 5 Jul 1999 07:51:39 +0000 (07:51 +0000)
committerNick Clifton <nickc@redhat.com>
Mon, 5 Jul 1999 07:51:39 +0000 (07:51 +0000)
ld/ChangeLog
ld/emultempl/armcoff.em
ld/emultempl/armelf.em
ld/emultempl/pe.em

index 1476db9be074820897f6b70fa85b1f3477495d3d..58e5b8a524eea5bae146808a7c351210b8b119e7 100644 (file)
@@ -1,3 +1,12 @@
+1999-07-05  Nick Clifton  <nickc@cygnus.com>
+
+       * emultempl/pe.em (after_open): Abort if input format is ARM and
+       output format is not. 
+       * emultempl/armcoff.em (after_open): Abort if input format is ARM
+       and output format is not. 
+       * emultempl/armelf.em (after_open): Abort if input format is ARM
+       and output format is not. 
+
 1999-07-02  Ian Lance Taylor  <ian@zembu.com>
 
        * ldlang.c: Revert change of 1999-06-23.
index 28a798fb79f2e8b8bc2eb9b053d4625fb364a660..484ff83a6607a2aff87d538e84ae044a5280f7e9 100644 (file)
@@ -148,11 +148,23 @@ gld${EMULATION_NAME}_before_allocation ()
 static void
 gld${EMULATION_NAME}_after_open ()
 {
-  LANG_FOR_EACH_INPUT_STATEMENT (is)
+  if (strstr (bfd_get_target (output_bfd), "arm") == NULL)
     {
-      if (bfd_arm_get_bfd_for_interworking (is->the_bfd, & link_info))
-       break;
+      /* 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)
+      {
+       if (bfd_arm_get_bfd_for_interworking (is->the_bfd, & link_info))
+         break;
+      }
+  }
 }
 
 static void
index 88d7e270370c8c1a5359094afe155ed6f93c28f2..a0f1a0dae54459abdbd771c9a8f367357ef2b6fc 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;
index c3a289fa72c66184b926ed2afe0df07e1695f681..bdab4f93d7e7c68549b1669eb5d07a923941f488 100644 (file)
@@ -652,6 +652,15 @@ gld_${EMULATION_NAME}_after_open ()
 #endif
 
 #if defined(TARGET_IS_armpe) || defined(TARGET_IS_arm_epoc_pe)
+  if (strstr (bfd_get_target (output_bfd), "arm") == NULL)
+    {
+      /* 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;
+    }
   {
     /* Find a BFD that can hold the interworking stubs.  */
     LANG_FOR_EACH_INPUT_STATEMENT (is)
This page took 0.045423 seconds and 4 git commands to generate.