This is the mail archive of the 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] Incremental 26/26: Fix problem with hidden/internal symbols

OK, one more -- then I'll stop numbering them.

This patch fixes a case where a hidden symbol overrides one defined in
a shared library. If we mark the def in the shared library as an
UNDEF, we'll complain about a reference to a hidden or internal symbol
during the incremental update where we don't complain during the full
link. Instead, the right thing to do is mark it as a DEF, and it'll go
through the same resolve logic as the first time around.


2011-06-08  Cary Coutant  <>

	* gold/
	(Output_section_incremental_inputs::write_info_blocks): Check for
	hidden and internal symbols.

diff --git a/gold/ b/gold/
index 710effc..cb97044 100644
--- a/gold/
+++ b/gold/
@@ -1669,9 +1669,15 @@ Output_section_incremental_inputs<size,
 	        if (sym->symtab_index() == -1U)
 		unsigned int flags = 0;
-		if (sym->source() == Symbol::FROM_OBJECT
-		    && sym->object() == obj
-		    && sym->is_defined())
+		// If the symbol has hidden or internal visibility, we
+		// mark it as defined in the shared object so we don't
+		// try to resolve it during an incremental update.
+		if (sym->visibility() == elfcpp::STV_HIDDEN
+		    || sym->visibility() == elfcpp::STV_INTERNAL)
+		else if (sym->source() == Symbol::FROM_OBJECT
+			 && sym->object() == obj
+			 && sym->is_defined())
 		else if (sym->is_copied_from_dynobj()
 			 && this->symtab_->get_copy_source(sym) == dynobj)

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