diff options
Diffstat (limited to 'bfd')
-rw-r--r-- | bfd/ChangeLog | 7 | ||||
-rw-r--r-- | bfd/elf32-sparc.c | 5 | ||||
-rw-r--r-- | bfd/elf64-sparc.c | 5 | ||||
-rw-r--r-- | bfd/elfxx-sparc.c | 35 | ||||
-rw-r--r-- | bfd/elfxx-sparc.h | 5 |
5 files changed, 52 insertions, 5 deletions
diff --git a/bfd/ChangeLog b/bfd/ChangeLog index 9fb8422..6e636d9 100644 --- a/bfd/ChangeLog +++ b/bfd/ChangeLog @@ -1,3 +1,10 @@ +2011-09-21 David S. Miller <davem@davemloft.net> + + * elfxx-sparc.c (_bfd_sparc_elf_merge_private_bfd_data): New. + * elfxx-sparc.h: Declare it. + * elf32-sparc.c (elf32_sparc_merge_private_bfd_data): Call it. + * elf64-sparc.c (elf64_sparc_merge_private_bfd_data): Likewise. + 2011-09-21 Tristan Gingold <gingold@adacore.com> * mach-o.c (bfd_mach_o_convert_section_name_to_bfd): Add comment. diff --git a/bfd/elf32-sparc.c b/bfd/elf32-sparc.c index 2d9deab..f722fcc 100644 --- a/bfd/elf32-sparc.c +++ b/bfd/elf32-sparc.c @@ -1,6 +1,7 @@ /* SPARC-specific support for 32-bit ELF Copyright 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, - 2003, 2004, 2005, 2006, 2007, 2010 Free Software Foundation, Inc. + 2003, 2004, 2005, 2006, 2007, 2010, 2011 + Free Software Foundation, Inc. This file is part of BFD, the Binary File Descriptor library. @@ -110,7 +111,7 @@ elf32_sparc_merge_private_bfd_data (bfd *ibfd, bfd *obfd) return FALSE; } - return TRUE; + return _bfd_sparc_elf_merge_private_bfd_data (ibfd, obfd); } /* The final processing done just before writing out the object file. diff --git a/bfd/elf64-sparc.c b/bfd/elf64-sparc.c index c4e97a7..f5bfe75 100644 --- a/bfd/elf64-sparc.c +++ b/bfd/elf64-sparc.c @@ -1,6 +1,7 @@ /* SPARC-specific support for 64-bit ELF Copyright 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, - 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 Free Software Foundation, Inc. + 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 + Free Software Foundation, Inc. This file is part of BFD, the Binary File Descriptor library. @@ -714,7 +715,7 @@ elf64_sparc_merge_private_bfd_data (bfd *ibfd, bfd *obfd) return FALSE; } } - return TRUE; + return _bfd_sparc_elf_merge_private_bfd_data (ibfd, obfd); } /* MARCO: Set the correct entry size for the .stab section. */ diff --git a/bfd/elfxx-sparc.c b/bfd/elfxx-sparc.c index d72dcba..438b7f5 100644 --- a/bfd/elfxx-sparc.c +++ b/bfd/elfxx-sparc.c @@ -4754,3 +4754,38 @@ _bfd_sparc_elf_plt_sym_val (bfd_vma i, const asection *plt, const arelent *rel) else return rel->address; } + +/* Merge backend specific data from an object file to the output + object file when linking. */ + +bfd_boolean +_bfd_sparc_elf_merge_private_bfd_data (bfd *ibfd, bfd *obfd) +{ + obj_attribute *in_attr, *in_attrs; + obj_attribute *out_attr, *out_attrs; + + if (!elf_known_obj_attributes_proc (obfd)[0].i) + { + /* This is the first object. Copy the attributes. */ + _bfd_elf_copy_obj_attributes (ibfd, obfd); + + /* Use the Tag_null value to indicate the attributes have been + initialized. */ + elf_known_obj_attributes_proc (obfd)[0].i = 1; + + return TRUE; + } + + in_attrs = elf_known_obj_attributes (ibfd)[OBJ_ATTR_GNU]; + out_attrs = elf_known_obj_attributes (obfd)[OBJ_ATTR_GNU]; + + in_attr = &in_attrs[Tag_GNU_Sparc_HWCAPS]; + out_attr = &out_attrs[Tag_GNU_Sparc_HWCAPS]; + + out_attr->i |= in_attr->i; + + /* Merge Tag_compatibility attributes and any common GNU ones. */ + _bfd_elf_merge_object_attributes (ibfd, obfd); + + return TRUE; +} diff --git a/bfd/elfxx-sparc.h b/bfd/elfxx-sparc.h index 36748ec..d95e825 100644 --- a/bfd/elfxx-sparc.h +++ b/bfd/elfxx-sparc.h @@ -1,5 +1,6 @@ /* SPARC ELF specific backend routines. - Copyright 2005, 2006, 2007, 2009, 2010 Free Software Foundation, Inc. + Copyright 2005, 2006, 2007, 2009, 2010, 2011 + Free Software Foundation, Inc. This file is part of BFD, the Binary File Descriptor library. @@ -146,3 +147,5 @@ extern bfd_boolean _bfd_sparc_elf_object_p (bfd *); extern bfd_vma _bfd_sparc_elf_plt_sym_val (bfd_vma, const asection *, const arelent *); +extern bfd_boolean _bfd_sparc_elf_merge_private_bfd_data + (bfd *, bfd *); |