public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
* gold patch committed: Don't add undefined symbols to dynsym
@ 2011-06-29 14:44 Ian Lance Taylor
  0 siblings, 0 replies; only message in thread
From: Ian Lance Taylor @ 2011-06-29 14:44 UTC (permalink / raw)
  To: binutils

[-- Attachment #1: Type: text/plain, Size: 582 bytes --]

PR 12818 points out that gold is putting a useless symbol in the dynamic
symbol table.  It turns out to be a simple bug: if a symbol is never
defined, then gold is putting it in the dynamic symbol table.  That is
useless; there is already code to ensure that any symbol mentioned in a
dynamic relocation goes into the dynamic symbol table.  This patch fixes
the problemm.  Committed to mainline.

Ian


2011-06-29  Ian Lance Taylor  <iant@google.com>

	PR gold/12818
	* symtab.cc (Symbol::should_add_dynsym_entry): Don't add undefined
	symbols which are not used in a relocation.



[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: patch --]
[-- Type: text/x-diff, Size: 583 bytes --]

Index: symtab.cc
===================================================================
RCS file: /cvs/src/src/gold/symtab.cc,v
retrieving revision 1.155
diff -u -p -r1.155 symtab.cc
--- symtab.cc	28 Jun 2011 05:39:45 -0000	1.155
+++ symtab.cc	29 Jun 2011 14:40:51 -0000
@@ -414,6 +414,7 @@ Symbol::should_add_dynsym_entry(Symbol_t
   // externally visible, we need to add it.
   if ((parameters->options().export_dynamic() || parameters->options().shared())
       && !this->is_from_dynobj()
+      && !this->is_undefined()
       && this->is_externally_visible())
     return true;
 

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2011-06-29 14:44 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-06-29 14:44 gold patch committed: Don't add undefined symbols to dynsym Ian Lance Taylor

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).