Update year range in copyright notice of all files.
[external/binutils.git] / bfd / elf64-sparc.c
index 1aa785b..ac66ab1 100644 (file)
@@ -1,5 +1,5 @@
 /* SPARC-specific support for 64-bit ELF
-   Copyright (C) 1993-2016 Free Software Foundation, Inc.
+   Copyright (C) 1993-2017 Free Software Foundation, Inc.
 
    This file is part of BFD, the Binary File Descriptor library.
 
@@ -426,11 +426,10 @@ elf64_sparc_add_symbol_hook (bfd *abfd, struct bfd_link_info *info,
 {
   static const char *const stt_types[] = { "NOTYPE", "OBJECT", "FUNCTION" };
 
-  if ((ELF_ST_TYPE (sym->st_info) == STT_GNU_IFUNC
-       || ELF_ST_BIND (sym->st_info) == STB_GNU_UNIQUE)
+  if (ELF_ST_TYPE (sym->st_info) == STT_GNU_IFUNC
       && (abfd->flags & DYNAMIC) == 0
       && bfd_get_flavour (info->output_bfd) == bfd_target_elf_flavour)
-    elf_tdata (info->output_bfd)->has_gnu_symbols = elf_gnu_symbol_any;
+    elf_tdata (info->output_bfd)->has_gnu_symbols |= elf_gnu_symbol_ifunc;
 
   if (ELF_ST_TYPE (sym->st_info) == STT_REGISTER)
     {
@@ -443,7 +442,7 @@ elf64_sparc_add_symbol_hook (bfd *abfd, struct bfd_link_info *info,
        case 2: reg -= 2; break;
        case 6: reg -= 4; break;
        default:
-          (*_bfd_error_handler)
+         _bfd_error_handler
             (_("%B: Only registers %%g[2367] can be declared using STT_REGISTER"),
              abfd);
          return FALSE;
@@ -463,7 +462,8 @@ elf64_sparc_add_symbol_hook (bfd *abfd, struct bfd_link_info *info,
 
       if (p->name != NULL && strcmp (p->name, *namep))
        {
-          (*_bfd_error_handler)
+         _bfd_error_handler
+           /* xgettext:c-format */
             (_("Register %%g%d used incompatibly: %s in %B, previously %s in %B"),
              abfd, p->abfd, (int) sym->st_value,
              **namep ? *namep : "#scratch",
@@ -486,7 +486,8 @@ elf64_sparc_add_symbol_hook (bfd *abfd, struct bfd_link_info *info,
 
                  if (type > STT_FUNC)
                    type = 0;
-                 (*_bfd_error_handler)
+                 _bfd_error_handler
+                   /* xgettext:c-format */
                    (_("Symbol `%s' has differing types: REGISTER in %B, previously %s in %B"),
                     abfd, p->abfd, *namep, stt_types[type]);
                  return FALSE;
@@ -531,7 +532,8 @@ elf64_sparc_add_symbol_hook (bfd *abfd, struct bfd_link_info *info,
 
            if (type > STT_FUNC)
              type = 0;
-           (*_bfd_error_handler)
+           _bfd_error_handler
+             /* xgettext:c-format */
              (_("Symbol `%s' has differing types: %s in %B, previously REGISTER in %B"),
               abfd, p->abfd, *namep, stt_types[type]);
            return FALSE;
@@ -637,8 +639,9 @@ elf64_sparc_symbol_processing (bfd *abfd ATTRIBUTE_UNUSED, asymbol *asym)
    object file when linking.  */
 
 static bfd_boolean
-elf64_sparc_merge_private_bfd_data (bfd *ibfd, bfd *obfd)
+elf64_sparc_merge_private_bfd_data (bfd *ibfd, struct bfd_link_info *info)
 {
+  bfd *obfd = info->output_bfd;
   bfd_boolean error;
   flagword new_flags, old_flags;
   int new_mm, old_mm;
@@ -684,7 +687,7 @@ elf64_sparc_merge_private_bfd_data (bfd *ibfd, bfd *obfd)
              && (old_flags & EF_SPARC_HAL_R1))
            {
              error = TRUE;
-             (*_bfd_error_handler)
+             _bfd_error_handler
                (_("%B: linking UltraSPARC specific with HAL specific code"),
                 ibfd);
            }
@@ -703,7 +706,8 @@ elf64_sparc_merge_private_bfd_data (bfd *ibfd, bfd *obfd)
       if (new_flags != old_flags)
         {
           error = TRUE;
-          (*_bfd_error_handler)
+         _bfd_error_handler
+           /* xgettext:c-format */
             (_("%B: uses different e_flags (0x%lx) fields than previous modules (0x%lx)"),
              ibfd, (long) new_flags, (long) old_flags);
         }
@@ -716,7 +720,7 @@ elf64_sparc_merge_private_bfd_data (bfd *ibfd, bfd *obfd)
           return FALSE;
         }
     }
-  return _bfd_sparc_elf_merge_private_bfd_data (ibfd, obfd);
+  return _bfd_sparc_elf_merge_private_bfd_data (ibfd, info);
 }
 
 /* MARCO: Set the correct entry size for the .stab section.  */
@@ -916,6 +920,7 @@ const struct elf_size_info elf64_sparc_size_info =
 #define elf_backend_plt_readonly 0
 #define elf_backend_want_plt_sym 1
 #define elf_backend_got_header_size 8
+#define elf_backend_want_dynrelro 1
 #define elf_backend_rela_normal 1
 
 /* Section 5.2.4 of the ABI specifies a 256-byte boundary for the table.  */