This is the mail archive of the binutils@sourceware.org mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

gold patch committed: Fix elflint complaint about hash table entsize


elflint wants to see the entsize of the .gnu.hash section to be 4 for
a 32-bit target and 0 for a 64-bit target.  That is what GNU ld does.
I committed this patch to make gold act the same way.

Ian


2009-12-29  Ian Lance Taylor  <iant@google.com>

	PR 10450
	* layout.cc (Layout::create_dynamic_symtab): Only set entsize of
	.gnu.hash table for a 32-bit target.


Index: layout.cc
===================================================================
RCS file: /cvs/src/src/gold/layout.cc,v
retrieving revision 1.152
diff -p -u -r1.152 layout.cc
--- layout.cc	30 Dec 2009 06:57:17 -0000	1.152
+++ layout.cc	30 Dec 2009 07:44:48 -0000
@@ -2978,7 +2978,12 @@ Layout::create_dynamic_symtab(const Inpu
       hashsec->add_output_section_data(hashdata);
 
       hashsec->set_link_section(dynsym);
-      hashsec->set_entsize(4);
+
+      // For a 64-bit target, the entries in .gnu.hash do not have a
+      // uniform size, so we only set the entry size for a 32-bit
+      // target.
+      if (parameters->target().get_size() == 32)
+	hashsec->set_entsize(4);
 
       odyn->add_section_address(elfcpp::DT_GNU_HASH, hashsec);
     }

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]