* symtab.h (needs_plt_entry): Check for unsatisfied reference from
authorCary Coutant <ccoutant@google.com>
Wed, 25 Mar 2009 01:34:25 +0000 (01:34 +0000)
committerCary Coutant <ccoutant@google.com>
Wed, 25 Mar 2009 01:34:25 +0000 (01:34 +0000)
an executable.
(needs_dynamic_reloc): Likewise.

gold/ChangeLog
gold/symtab.h

index b51509a5fa85f0a6a9e2f395d3fcc9b3c8bec5ad..7044e284127b2ad3c354e2375ecc62e70bc778ef 100644 (file)
@@ -1,3 +1,9 @@
+2009-03-24  Cary Coutant  <ccoutant@google.com>
+
+       * symtab.h (needs_plt_entry): Check for unsatisfied reference from
+       an executable.
+       (needs_dynamic_reloc): Likewise.
+
 2009-03-24  Ian Lance Taylor  <iant@google.com>
 
        * yyscript.y (file_cmd): Recognize EXTERN.
index c96c6fbefa3f52cd5c4eb23356f5039c2d94ee37..660fc4d45776e5f13ea698b8964655de61c101a1 100644 (file)
@@ -530,6 +530,10 @@ class Symbol
   bool
   needs_plt_entry() const
   {
+    // An undefined symbol from an executable does not need a PLT entry.
+    if (this->is_undefined() && !parameters->options().shared())
+      return false;
+
     return (!parameters->doing_static_link()
             && this->type() == elfcpp::STT_FUNC
             && (this->is_from_dynobj()
@@ -561,10 +565,10 @@ class Symbol
     if (parameters->doing_static_link())
       return false;
 
-    // A reference to a weak undefined symbol from an executable should be
+    // A reference to an undefined symbol from an executable should be
     // statically resolved to 0, and does not need a dynamic relocation.
     // This matches gnu ld behavior.
-    if (this->is_weak_undefined() && !parameters->options().shared())
+    if (this->is_undefined() && !parameters->options().shared())
       return false;
 
     // A reference to an absolute symbol does not need a dynamic relocation.
This page took 0.030584 seconds and 4 git commands to generate.