elf/x86-64: Subtract __ImageBase for R_AMD64_IMAGEBASE
[binutils-gdb.git] / bfd / elf32-rx.c
index 89b7ed50954dc2a8081edbae8819f03909193fe9..e2f4c9fb34a0fde327c12b8c89e5cd22e25ef4b8 100644 (file)
@@ -1,5 +1,5 @@
 /* Renesas RX specific support for 32-bit ELF.
-   Copyright (C) 2008-2020 Free Software Foundation, Inc.
+   Copyright (C) 2008-2021 Free Software Foundation, Inc.
 
    This file is part of BFD, the Binary File Descriptor library.
 
@@ -3037,8 +3037,7 @@ elf32_rx_relax_section (bfd *                    abfd,
   return TRUE;
 
  error_return:
-  if (free_contents != NULL)
-    free (free_contents);
+  free (free_contents);
 
   if (shndx_buf != NULL)
     {
@@ -3046,8 +3045,7 @@ elf32_rx_relax_section (bfd *                    abfd,
       free (shndx_buf);
     }
 
-  if (free_intsyms != NULL)
-    free (free_intsyms);
+  free (free_intsyms);
 
   return FALSE;
 }
@@ -3088,10 +3086,8 @@ bfd_elf32_rx_set_target_flags (bfd_boolean user_no_warn_mismatch,
    Returns a static pointer.  */
 
 static const char *
-describe_flags (flagword flags)
+describe_flags (flagword flags, char *buf)
 {
-  static char buf [128];
-
   buf[0] = 0;
 
   if (flags & E_FLAG_RX_64BIT_DOUBLES)
@@ -3172,13 +3168,15 @@ rx_elf_merge_private_bfd_data (bfd * ibfd, struct bfd_link_info *info)
            }
          else
            {
+             char buf[128];
+
              _bfd_error_handler (_("there is a conflict merging the"
                                    " ELF header flags from %pB"),
                                  ibfd);
              _bfd_error_handler (_("  the input  file's flags: %s"),
-                                 describe_flags (new_flags));
+                                 describe_flags (new_flags, buf));
              _bfd_error_handler (_("  the output file's flags: %s"),
-                                 describe_flags (old_flags));
+                                 describe_flags (old_flags, buf));
              error = TRUE;
            }
        }
@@ -3197,6 +3195,7 @@ rx_elf_print_private_bfd_data (bfd * abfd, void * ptr)
 {
   FILE * file = (FILE *) ptr;
   flagword flags;
+  char buf[128];
 
   BFD_ASSERT (abfd != NULL && ptr != NULL);
 
@@ -3206,7 +3205,7 @@ rx_elf_print_private_bfd_data (bfd * abfd, void * ptr)
   flags = elf_elfheader (abfd)->e_flags;
   fprintf (file, _("private flags = 0x%lx:"), (long) flags);
 
-  fprintf (file, "%s", describe_flags (flags));
+  fprintf (file, "%s", describe_flags (flags, buf));
   return TRUE;
 }