ehdr_start twiddles
[deliverable/binutils-gdb.git] / ld / emultempl / xtensaelf.em
index ed015a23c6ae775efa4192964adc9733d813cd66..7b04a7ad0b50befa9e8db1626fe3bb60e7a91c57 100644 (file)
@@ -1,6 +1,5 @@
 # This shell script emits a C file. -*- C -*-
-#   Copyright 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011
-#   Free Software Foundation, Inc.
+#   Copyright (C) 2003-2018 Free Software Foundation, Inc.
 #
 # This file is part of the GNU Binutils.
 #
@@ -27,7 +26,6 @@ fragment <<EOF
 
 #include <xtensa-config.h>
 #include "../bfd/elf-bfd.h"
-#include "../bfd/libbfd.h"
 #include "elf/xtensa.h"
 #include "bfd.h"
 
@@ -117,12 +115,7 @@ replace_insn_sec_with_prop_sec (bfd *abfd,
 
   if (insn_sec->size != 0)
     {
-      insn_contents = (bfd_byte *) bfd_malloc (insn_sec->size);
-      if (insn_contents == NULL)
-       {
-         *error_message = _("out of memory");
-         goto cleanup;
-       }
+      insn_contents = (bfd_byte *) xmalloc (insn_sec->size);
       if (! bfd_get_section_contents (abfd, insn_sec, insn_contents,
                                      (file_ptr) 0, insn_sec->size))
        {
@@ -274,7 +267,7 @@ replace_instruction_table_sections (bfd *abfd, asection *sec)
       if (! replace_insn_sec_with_prop_sec (abfd, insn_sec_name, prop_sec_name,
                                            &message))
        {
-         einfo (_("%P: warning: failed to convert %s table in %B (%s); subsequent disassembly may be incomplete\n"),
+         einfo (_("%P: warning: failed to convert %s table in %pB (%s); subsequent disassembly may be incomplete\n"),
                 insn_sec_name, abfd, message);
        }
     }
@@ -391,7 +384,7 @@ check_xtensa_info (bfd *abfd, asection *info_sec)
 
   data = xmalloc (info_sec->size);
   if (! bfd_get_section_contents (abfd, info_sec, data, 0, info_sec->size))
-    einfo (_("%F%P:%B: cannot read contents of section %A\n"), abfd, info_sec);
+    einfo (_("%F%P: %pB: cannot read contents of section %pA\n"), abfd, info_sec);
 
   if (info_sec->size > 24
       && info_sec->size >= 24 + bfd_get_32 (abfd, data + 4)
@@ -402,11 +395,11 @@ check_xtensa_info (bfd *abfd, asection *info_sec)
                                          &mismatch, &errmsg))
     {
       if (mismatch)
-       einfo (_("%P:%B: warning: incompatible Xtensa configuration (%s)\n"),
+       einfo (_("%P: %pB: warning: incompatible Xtensa configuration (%s)\n"),
               abfd, errmsg);
     }
   else
-    einfo (_("%P:%B: warning: cannot parse .xtensa.info section\n"), abfd);
+    einfo (_("%P: %pB: warning: cannot parse .xtensa.info section\n"), abfd);
 
   free (data);
 }
@@ -457,7 +450,7 @@ elf_xtensa_before_allocation (void)
         cannot go any further if there are any mismatches.  */
       if ((is_big_endian && f->the_bfd->xvec->byteorder == BFD_ENDIAN_LITTLE)
          || (!is_big_endian && f->the_bfd->xvec->byteorder == BFD_ENDIAN_BIG))
-       einfo (_("%F%P: cross-endian linking for %B not supported\n"),
+       einfo (_("%F%P: cross-endian linking for %pB not supported\n"),
               f->the_bfd);
 
       if (! first_bfd)
@@ -1311,7 +1304,7 @@ is_inconsistent_linkonce_section (asection *sec)
      for Tensilica's XCC compiler.  */
   name = sec_name + linkonce_len;
   if (CONST_STRNEQ (name, "prop."))
-    name = strchr (name + 5, '.') + 1;
+    name = strchr (name + 5, '.') ? strchr (name + 5, '.') + 1 : name + 5;
   else if (name[1] == '.'
           && (name[0] == 'p' || name[0] == 'e' || name[0] == 'h'))
     name += 2;
@@ -1439,7 +1432,7 @@ xtensa_wild_group_interleave_callback (lang_statement_union_type *statement)
          struct wildcard_list *l;
          for (l = w->section_list; l != NULL; l = l->next)
            {
-             if (l->spec.sorted == TRUE)
+             if (l->spec.sorted == by_name)
                {
                  no_reorder = TRUE;
                  break;
@@ -1817,8 +1810,10 @@ ld_local_file_relocations_fit (lang_statement_union_type *statement,
                  bfd_vma target_addr = e->tgt->output_offset & ~3;
                  if (l32r_addr < target_addr)
                    {
+                     fflush (stdout);
                      fprintf (stderr, "Warning: "
                               "l32r target section before l32r\n");
+                     fflush (stderr);
                      return FALSE;
                    }
 
@@ -1885,7 +1880,7 @@ ld_xtensa_insert_page_offsets (bfd_vma dot,
                etree_type *name_op = exp_nameop (NAME, ".");
                etree_type *addend_op = exp_intop (1 << xtensa_page_power);
                etree_type *add_op = exp_binop ('+', name_op, addend_op);
-               etree_type *assign_op = exp_assign (".", add_op);
+               etree_type *assign_op = exp_assign (".", add_op, FALSE);
 
                lang_assignment_statement_type *assign_stmt;
                lang_statement_union_type *assign_union;
This page took 0.026669 seconds and 4 git commands to generate.