Add support for debuginfod to the binutils (disable by default, enabled via a configu...
[deliverable/binutils-gdb.git] / ld / ldemul.c
index ab23dee41b67eba9ccca48d4bae6f11d180785c0..1f5228d2a4a1267c1da7e4c426783a78b64ac418 100644 (file)
@@ -1,5 +1,5 @@
 /* ldemul.c -- clearing house for ld emulation states
-   Copyright (C) 1991-2019 Free Software Foundation, Inc.
+   Copyright (C) 1991-2020 Free Software Foundation, Inc.
 
    This file is part of the GNU Binutils.
 
@@ -236,6 +236,29 @@ after_parse_default (void)
 void
 after_open_default (void)
 {
+  link_info.big_endian = TRUE;
+
+  if (bfd_big_endian (link_info.output_bfd))
+    ;
+  else if (bfd_little_endian (link_info.output_bfd))
+    link_info.big_endian = FALSE;
+  else
+    {
+      if (command_line.endian == ENDIAN_BIG)
+       ;
+      else if (command_line.endian == ENDIAN_LITTLE)
+       link_info.big_endian = FALSE;
+      else if (command_line.endian == ENDIAN_UNSET)
+       {
+         LANG_FOR_EACH_INPUT_STATEMENT (s)
+           if (s->the_bfd != NULL)
+             {
+               if (bfd_little_endian (s->the_bfd))
+                 link_info.big_endian = FALSE;
+               break;
+             }
+       }
+    }
 }
 
 void
This page took 0.040507 seconds and 4 git commands to generate.