From Cary Coutant: Fix last patch.

This commit is contained in:
Ian Lance Taylor
2008-01-24 00:51:57 +00:00
parent 55a934330a
commit 5240d12aa0

View File

@ -508,18 +508,11 @@ class Symbol
return true; return true;
// A function call that can branch to a local PLT entry does not need // A function call that can branch to a local PLT entry does not need
// a dynamic relocation. // a dynamic relocation. A non-pic pc-relative function call in a
if ((flags & FUNCTION_CALL) && this->has_plt_offset()) // shared library cannot use a PLT entry.
return false;
// A non-pic pc-relative function call in a shared library whose target
// is defined in the same load module does not need a dynamic relocation.
// Even if the target is preemptible, we will bind directly, since we
// cannot use a PLT entry in this case.
if ((flags & FUNCTION_CALL) if ((flags & FUNCTION_CALL)
&& (flags & NON_PIC_REF) && this->has_plt_offset()
&& this->is_defined() && !((flags & NON_PIC_REF) && parameters->output_is_shared()))
&& parameters->output_is_shared())
return false; return false;
// A reference to any PLT entry in a non-position-independent executable // A reference to any PLT entry in a non-position-independent executable