daily update
[deliverable/binutils-gdb.git] / bfd / elf64-sparc.c
index 6af2b15166ce340df1b5ff71272b611d6729c68a..d636a20943102031784c635894d5e0fdc4141aba 100644 (file)
@@ -69,8 +69,6 @@ static boolean sparc64_elf_output_arch_syms
 static void sparc64_elf_symbol_processing
   PARAMS ((bfd *, asymbol *));
 
-static boolean sparc64_elf_copy_private_bfd_data
-  PARAMS ((bfd *, bfd *));
 static boolean sparc64_elf_merge_private_bfd_data
   PARAMS ((bfd *, bfd *));
 
@@ -2053,7 +2051,15 @@ sparc64_elf_relocate_section (output_bfd, info, input_bfd, input_section,
                  if (info->shared
                      && ((!info->symbolic && h->dynindx != -1)
                          || !(h->elf_link_hash_flags
-                              & ELF_LINK_HASH_DEF_REGULAR)))
+                              & ELF_LINK_HASH_DEF_REGULAR))
+                     && ((input_section->flags & SEC_ALLOC) != 0
+                         /* DWARF will emit R_SPARC_{32,64} relocations in
+                            its sections against symbols defined externally
+                            in shared libraries.  We can't do anything
+                            with them here.  */
+                         || ((input_section->flags & SEC_DEBUGGING) != 0
+                             && (h->elf_link_hash_flags
+                                 & ELF_LINK_HASH_DEF_DYNAMIC) != 0)))
                    skip_it = true;
                  break;
                }
@@ -2176,21 +2182,11 @@ sparc64_elf_relocate_section (output_bfd, info, input_bfd, input_section,
 
                skip = false;
 
-               if (elf_section_data (input_section)->stab_info == NULL)
-                 outrel.r_offset = rel->r_offset;
-               else
-                 {
-                   bfd_vma off;
-
-                   off = (_bfd_stab_section_offset
-                          (output_bfd, &elf_hash_table (info)->stab_info,
-                           input_section,
-                           &elf_section_data (input_section)->stab_info,
-                           rel->r_offset));
-                   if (off == MINUS_ONE)
-                     skip = true;
-                   outrel.r_offset = off;
-                 }
+               outrel.r_offset =
+                 _bfd_elf_section_offset (output_bfd, info, input_section,
+                                          rel->r_offset);
+               if (outrel.r_offset == (bfd_vma) -1)
+                 skip = true;
 
                outrel.r_offset += (input_section->output_section->vma
                                    + input_section->output_offset);
@@ -2944,24 +2940,6 @@ sparc64_elf_reloc_type_class (rela)
 \f
 /* Functions for dealing with the e_flags field.  */
 
-/* Copy backend specific data from one object module to another */
-static boolean
-sparc64_elf_copy_private_bfd_data (ibfd, obfd)
-     bfd *ibfd, *obfd;
-{
-  if (   bfd_get_flavour (ibfd) != bfd_target_elf_flavour
-      || bfd_get_flavour (obfd) != bfd_target_elf_flavour)
-    return true;
-
-  BFD_ASSERT (!elf_flags_init (obfd)
-              || (elf_elfheader (obfd)->e_flags
-                  == elf_elfheader (ibfd)->e_flags));
-
-  elf_elfheader (obfd)->e_flags = elf_elfheader (ibfd)->e_flags;
-  elf_flags_init (obfd) = true;
-  return true;
-}
-
 /* Merge backend specific data from an object file to the output
    object file when linking.  */
 
@@ -3183,8 +3161,6 @@ const struct elf_size_info sparc64_elf_size_info =
   sparc64_elf_print_symbol_all
 #define elf_backend_output_arch_syms \
   sparc64_elf_output_arch_syms
-#define bfd_elf64_bfd_copy_private_bfd_data \
-  sparc64_elf_copy_private_bfd_data
 #define bfd_elf64_bfd_merge_private_bfd_data \
   sparc64_elf_merge_private_bfd_data
 
This page took 0.024047 seconds and 4 git commands to generate.