* libxcoff.h (struct xcoff_backend_data_rec): Constify src param
[binutils-gdb.git] / bfd / elf32-m68k.c
index 07cd06124fdf67ba2602b5a9a9fcaeabfddbe53a..a3df85d5b5944e7b9e9e7b4490e9e902c1161a76 100644 (file)
@@ -1,5 +1,6 @@
 /* Motorola 68k series support for 32-bit ELF
-   Copyright 1993, 95, 96, 97, 98, 1999 Free Software Foundation, Inc.
+   Copyright 1993, 1995, 1996, 1997, 1998, 1999, 2000, 2001
+   Free Software Foundation, Inc.
 
 This file is part of BFD, the Binary File Descriptor library.
 
@@ -181,7 +182,6 @@ reloc_type_lookup (abfd, code)
 /* end code generated by elf.el */
 
 #define USE_RELA
-
 \f
 /* Functions for the m68k ELF linker.  */
 
@@ -1324,7 +1324,6 @@ elf_m68k_size_dynamic_sections (output_bfd, info)
    in regular objects.  We allocated space for them in the check_relocs
    routine, but we won't fill them in in the relocate_section routine.  */
 
-/*ARGSUSED*/
 static boolean
 elf_m68k_discard_copies (h, ignore)
      struct elf_m68k_link_hash_entry *h;
@@ -1464,7 +1463,14 @@ elf_m68k_relocate_section (output_bfd, info, input_bfd, input_section,
                      && ((! info->symbolic && h->dynindx != -1)
                          || (h->elf_link_hash_flags
                              & ELF_LINK_HASH_DEF_REGULAR) == 0)
-                     && (input_section->flags & SEC_ALLOC) != 0
+                     && ((input_section->flags & SEC_ALLOC) != 0
+                         /* DWARF will emit R_68K_32 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))
                      && (r_type == R_68K_8
                          || r_type == R_68K_16
                          || r_type == R_68K_32