This is the mail archive of the
binutils@sourceware.cygnus.com
mailing list for the binutils project.
Re: GNU linker and Function stubs on mips.
- To: Ian Lance Taylor <ian at zembu dot com>
- Subject: Re: GNU linker and Function stubs on mips.
- From: Koundinya K <knk at dde dot dk>
- Date: Wed, 01 Mar 2000 12:17:24 -0700
- CC: binutils at sourceware dot cygnus dot com
- Organization: DDE
- References: <38B88B26.6E668A35@dde.dk> <20000227024222.12298.qmail@daffy.airs.com> <38BB0D4A.B3CBF1FD@dde.dk> <20000229004038.1453.qmail@daffy.airs.com>
Hi Ian,
I am glad to say that the problem has now been solved. After hours of debugging
I really hit myself for the thing that was causing all the problem :-(. The problem
was in _bfd_mips_elf_adjust_dynamic_symbol().
You will be quite surprised to see the change required. Here is the cvs diff..
*************** _bfd_mips_elf_adjust_dynamic_symbol (inf
*** 7612,7618 ****
/* For a function, create a stub, if needed. */
if (h->type == STT_FUNC
! || (h->elf_link_hash_flags & ELF_LINK_HASH_NEEDS_PLT) != 0)
{
if (! elf_hash_table (info)->dynamic_sections_created)
return true;
--- 7708,7714 ----
/* For a function, create a stub, if needed. */
if (h->type == STT_FUNC
! && (h->elf_link_hash_flags & ELF_LINK_HASH_NEEDS_PLT) != 0)
{
if (! elf_hash_table (info)->dynamic_sections_created)
return true;
As we know, we need to create a function stub only for a function that require a PLT
and not otherwise.
The function stubs were being generated irrespective of whether the function
requires a PLT or not, because the test conditions for this were being *ORed*.
Ideally the test conditions should be *ANDed*. That is what I did.
First I compiled the simple hello and compared the dump against the dump of a hello
from the native linker.
They just match !!
Immediately I compiled bash and it just works fine !!. All undefined symbols that
are referenced by non-call relocs do not have the stubs (Finally !!). I did a couple
of other tests too and had no problems.
I feel that this change is required for all mips targets. Because again on MIPS
function stubs are needed *if* and *only* if the function requires a PLT abd *not*
otherwise.
Ian, what do you think ? If this change is O.K for you, can you please check in the
change ??.
Thanks a lot !!
With best regards.
Koundinya