* elf32-m68hc1x.c (elf32_m68hc11_merge_symbol_attribute): New function.
[deliverable/binutils-gdb.git] / bfd / elf32-m68hc1x.c
index 2107486886834287677d13e8757547dd76a6abb5..e1da8b286cde6af3c76a5670211351b41a24e6ce 100644 (file)
@@ -1,6 +1,6 @@
 /* Motorola 68HC11/HC12-specific support for 32-bit ELF
    Copyright 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008,
-   2009, 2010  Free Software Foundation, Inc.
+   2009, 2010, 2011, 2012 Free Software Foundation, Inc.
    Contributed by Stephane Carrez (stcarrez@nerim.fr)
 
    This file is part of BFD, the Binary File Descriptor library.
@@ -214,6 +214,20 @@ elf32_m68hc11_add_symbol_hook (bfd *abfd, struct bfd_link_info *info,
   return TRUE;
 }
 
+/* Merge non-visibility st_other attributes, STO_M68HC12_FAR and
+   STO_M68HC12_INTERRUPT.  */
+
+void
+elf32_m68hc11_merge_symbol_attribute (struct elf_link_hash_entry *h,
+                                     const Elf_Internal_Sym *isym,
+                                     bfd_boolean definition,
+                                     bfd_boolean dynamic ATTRIBUTE_UNUSED)
+{
+  if (definition)
+    h->other = ((isym->st_other & ~ELF_ST_VISIBILITY (-1))
+               | ELF_ST_VISIBILITY (h->other));
+}
+
 /* External entry points for sizing and building linker stubs.  */
 
 /* Set up various things so that we can make a list of input sections
@@ -971,15 +985,8 @@ elf32_m68hc11_relocate_section (bfd *output_bfd ATTRIBUTE_UNUSED,
        }
 
       if (sec != NULL && elf_discarded_section (sec))
-       {
-         /* For relocs against symbols from removed linkonce sections,
-            or sections discarded by a linker script, we just want the
-            section contents zeroed.  Avoid any special processing.  */
-         _bfd_clear_contents (howto, input_bfd, contents + rel->r_offset);
-         rel->r_info = 0;
-         rel->r_addend = 0;
-         continue;
-       }
+       RELOC_AGAINST_DISCARDED_SECTION (info, input_bfd, input_section,
+                                        rel, relend, howto, contents);
 
       if (info->relocatable)
        {
@@ -1195,7 +1202,7 @@ _bfd_m68hc11_elf_merge_private_bfd_data (bfd *ibfd, bfd *obfd)
   flagword new_flags;
   bfd_boolean ok = TRUE;
 
-  /* Check if we have the same endianess */
+  /* Check if we have the same endianness */
   if (!_bfd_generic_verify_endian_match (ibfd, obfd))
     return FALSE;
 
This page took 0.024455 seconds and 4 git commands to generate.