rpms/binutils/devel binutils-2.17.50.0.8-rh219629.patch, NONE, 1.1 binutils.spec, 1.107, 1.108

fedora-cvs-commits at redhat.com fedora-cvs-commits at redhat.com
Sat Dec 23 08:45:09 UTC 2006


Author: jakub

Update of /cvs/dist/rpms/binutils/devel
In directory cvs.devel.redhat.com:/tmp/cvs-serv2841

Modified Files:
	binutils.spec 
Added Files:
	binutils-2.17.50.0.8-rh219629.patch 
Log Message:
2.17.50.0.8-2

binutils-2.17.50.0.8-rh219629.patch:
 elf-bfd.h      |    7 +++++++
 elf64-ppc.c    |   12 ++++++++++++
 elflink.c      |    2 ++
 elfxx-target.h |    4 ++++
 4 files changed, 25 insertions(+)

--- NEW FILE binutils-2.17.50.0.8-rh219629.patch ---
2006-12-23  Jakub Jelinek  <jakub at redhat.com>

	* elf-bfd.h (struct elf_backend_data): Add as_needed_cleanup hook.
	* elfxx-target.h (elf_backend_as_needed_cleanup): Define.
	(elfNN_bed): Add as_needed_cleanup hook.
	* elflink.c (elf_link_add_object_symbols): Call it when reverting
	hash table changes for unneeded --as-needed input.
	* elf64-ppc64.c (elf_backend_as_needed_cleanup): Define.
	(ppc64_elf_as_needed_cleanup): New function.

--- bfd/elf-bfd.h.jj	2006-12-18 15:01:17.000000000 +0100
+++ bfd/elf-bfd.h	2006-12-18 16:30:36.000000000 +0100
@@ -711,6 +711,13 @@ struct elf_backend_data
   bfd_boolean (*check_directives)
     (bfd *abfd, struct bfd_link_info *info);
 
+  /* The AS_NEEDED_CLEANUP function is called once per --as-needed
+     input file that was not needed by the add_symbols phase of the
+     ELF backend linker.  The function must undo any target specific
+     changes in the symbol hash table.  */
+  bfd_boolean (*as_needed_cleanup)
+    (bfd *abfd, struct bfd_link_info *info);
+
   /* The ADJUST_DYNAMIC_SYMBOL function is called by the ELF backend
      linker for every symbol which is defined by a dynamic object and
      referenced by a regular object.  This is called after all the
--- bfd/elfxx-target.h.jj	2006-10-21 12:55:56.000000000 +0200
+++ bfd/elfxx-target.h	2006-12-18 16:31:55.000000000 +0100
@@ -372,6 +372,9 @@
 #ifndef elf_backend_check_directives
 #define elf_backend_check_directives	0
 #endif
+#ifndef elf_backend_as_needed_cleanup
+#define elf_backend_as_needed_cleanup	0
+#endif
 #ifndef elf_backend_adjust_dynamic_symbol
 #define elf_backend_adjust_dynamic_symbol 0
 #endif
@@ -604,6 +607,7 @@ static struct elf_backend_data elfNN_bed
   elf_backend_omit_section_dynsym,
   elf_backend_check_relocs,
   elf_backend_check_directives,
+  elf_backend_as_needed_cleanup,
   elf_backend_adjust_dynamic_symbol,
   elf_backend_always_size_sections,
   elf_backend_size_dynamic_sections,
--- bfd/elflink.c.jj	2006-12-18 15:01:17.000000000 +0100
+++ bfd/elflink.c	2006-12-18 16:40:32.000000000 +0100
@@ -4251,6 +4251,8 @@ elf_link_add_object_symbols (bfd *abfd, 
       unsigned int i;
 
       /* Restore the symbol table.  */
+      if (bed->as_needed_cleanup)
+	(*bed->as_needed_cleanup) (abfd, info);
       old_hash = (char *) old_tab + tabsize;
       old_ent = (char *) old_hash + hashsize;
       sym_hash = elf_sym_hashes (abfd);
--- bfd/elf64-ppc.c.jj	2006-12-18 15:01:17.000000000 +0100
+++ bfd/elf64-ppc.c	2006-12-18 16:36:05.000000000 +0100
@@ -88,6 +88,7 @@ static bfd_vma opd_entry_value
 #define elf_backend_copy_indirect_symbol      ppc64_elf_copy_indirect_symbol
 #define elf_backend_add_symbol_hook	      ppc64_elf_add_symbol_hook
 #define elf_backend_check_directives	      ppc64_elf_check_directives
+#define elf_backend_as_needed_cleanup	      ppc64_elf_as_needed_cleanup
 #define elf_backend_archive_symbol_lookup     ppc64_elf_archive_symbol_lookup
 #define elf_backend_check_relocs	      ppc64_elf_check_relocs
 #define elf_backend_gc_mark_dynamic_ref       ppc64_elf_gc_mark_dynamic_ref
@@ -4247,6 +4248,17 @@ ppc64_elf_check_directives (bfd *ibfd, s
   return TRUE;
 }
 
+/* Undo hash table changes when an --as-needed input file is determined
+   not to be needed.  */
+
+static bfd_boolean
+ppc64_elf_as_needed_cleanup (bfd *ibfd ATTRIBUTE_UNUSED,
+			     struct bfd_link_info *info)
+{
+  ppc_hash_table (info)->dot_syms = NULL;
+  return TRUE;
+}
+
 static bfd_boolean
 update_local_sym_info (bfd *abfd, Elf_Internal_Shdr *symtab_hdr,
 		       unsigned long r_symndx, bfd_vma r_addend, int tls_type)


Index: binutils.spec
===================================================================
RCS file: /cvs/dist/rpms/binutils/devel/binutils.spec,v
retrieving revision 1.107
retrieving revision 1.108
diff -u -r1.107 -r1.108
--- binutils.spec	3 Dec 2006 20:44:56 -0000	1.107
+++ binutils.spec	23 Dec 2006 08:45:06 -0000	1.108
@@ -1,7 +1,7 @@
 Summary: A GNU collection of binary utilities.
 Name: binutils
 Version: 2.17.50.0.8
-Release: 1
+Release: 2
 License: GPL
 Group: Development/Tools
 URL: http://sources.redhat.com/binutils
@@ -14,6 +14,7 @@
 Patch6: binutils-2.17.50.0.8-standards.patch
 Patch7: binutils-2.17.50.0.8-build-fixes.patch
 Patch8: binutils-2.17.50.0.8-bz3607.patch
+Patch9: binutils-2.17.50.0.8-rh219629.patch
 
 Buildroot: %{_tmppath}/binutils-root
 BuildRequires: texinfo >= 4.0, dejagnu, gettext, flex, bison
@@ -63,6 +64,7 @@
 %patch6 -p0 -b .standards~
 %patch7 -p0 -b .build-fixes~
 %patch8 -p0 -b .bz3607~
+%patch9 -p0 -b .rh219629~
 
 # On ppc64 we might use 64K pages
 sed -i -e '/#define.*ELF_COMMONPAGESIZE/s/0x1000$/0x10000/' bfd/elf*ppc.c
@@ -205,6 +207,9 @@
 %{_infodir}/bfd*info*
 
 %changelog
+* Sat Dec 23 2006 Jakub Jelinek <jakub at redhat.com> 2.17.50.0.8-2
+- fix --as-needed on ppc64 (#219629)
+
 * Sun Dec  3 2006 Jakub Jelinek <jakub at redhat.com> 2.17.50.0.8-1
 - update to 2.17.50.0.8
 - initialize frch_cfi_data (BZ#3607)




More information about the fedora-cvs-commits mailing list