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]

Re: [gold patch] Fix problem with --export-dynamic-symbol and versioned symbols

> Seems like this would do the wrong thing for
> ld --defsym=foo=0 --export-dynamic-symbol=foo

How about this instead?


2012-05-22  Cary Coutant  <>

	* (Symbol::should_add_dynsym_entry): Check for relocatable
	object before exporting symbol.

commit 6398f58d89ec265905e2aa57a5d20211cf8045ed
Author: Cary Coutant <>
Date:   Tue May 22 13:58:32 2012 -0700

    Don't export symbols from shared objects.

diff --git a/gold/ b/gold/
index a820b0a..d49b24b 100644
--- a/gold/
+++ b/gold/
@@ -365,8 +365,9 @@ Symbol::should_add_dynsym_entry(Symbol_table* symtab) const

   // If the symbol was forced dynamic in a --dynamic-list file
   // or an --export-dynamic-symbol option, add it.
-  if (parameters->options().in_dynamic_list(this->name())
-      || parameters->options().is_export_dynamic_symbol(this->name()))
+  if (!this->is_from_dynobj()
+      && (parameters->options().in_dynamic_list(this->name())
+         || parameters->options().is_export_dynamic_symbol(this->name())))
       if (!this->is_forced_local())
         return true;

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