This is the mail archive of the binutils@sources.redhat.com 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: RFC: linker enhancements


On Wed, Mar 17, 2004 at 05:07:25PM -0800, H. J. Lu wrote:
> On Thu, Mar 18, 2004 at 10:04:56AM +1030, Alan Modra wrote:
> > More than that.  Not only are the later comments wrong, but the
> > dt_needed code doesn't do anything now.  That was what was confusing
> > me.  I'll rip it out and fix the comments.
> 
> Some codes in _bfd_elf_merge_symbol are dead because of my weak symbol
> change. But I was too afraid to break something to remove them :-(.

I understand the feeling. :)  After ripping out the dt_needed code
from _bfd_elf_merge_symbol, I have FAIL: vers19 in the ld testsuite.

Did not find "  required from tmpdir/vers18.so:"
Version References:
  required from libc.so.6:
    0x0d696910 0x00 03 GLIBC_2.0
  required from vers17.so:
    0x0a7922b0 0x00 02 VERS_2.0


The reason is that vers19 links against vers18.so, which has DT_NEEDED
vers17.so.  vers18.so defines

    20: 000004de    14 FUNC    WEAK   DEFAULT    7 show_foo
    21: 0000050c    18 FUNC    WEAK   DEFAULT    7 show_foo@@VERS_2.0

while vers17.so defines

    25: 000003a8    10 FUNC    GLOBAL DEFAULT    6 show_foo@@VERS_2.0


So, my remark about the dt_needed code doing nothing is wrong.  Is
the vers19 test correct though?  I'd really like to remove the
dt_needed param from _bfd_elf_merge_symbol, as the weird behaviour I
wrongly believed to happen with regular files and shared libs in
http://sources.redhat.com/ml/binutils/2004-03/msg00395.html, still
happens with two shared libraries.

If you believe that the vers19 test is correct, then we ought to _not_
clear dt_needed inside the symbol loop of elf_link_add_object_symbols,
and instead use some other flag to say that DT_NEEDED has been added.

-- 
Alan Modra
IBM OzLabs - Linux Technology Centre


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