This is the mail archive of the binutils@sourceware.cygnus.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]

Re: Interesting issue


   Date: Thu, 14 Oct 1999 14:05:02 -0600
   From: Jeffrey A Law <law@cygnus.com>

     In message <19991014193710.6119.qmail@daffy.airs.com>you write:
     > Actually, it doesn't.  As far as I know, -static really just affects
     > the search path.  If you compile a .o with -fpic, ld typically has to
     > build a procedure linkage table and so forth.
     > 
     > ld should create a .dynamic section if it needs one.  Currently it
     > thinks it needs one if you linked against a shared library.
   OK.  This seems like the place to attack this problem since we're not going
   to link against any shared libraries, but we still need to create the
   .dynamic sections.

   Any suggestions on how to force the add_object_symbols routine  to create
   the dynamic sections even if it hasn't seen a dynamic object?

   Or is there some other hook I could use to call into the routine to make the
   dynamic sections?

Yes, use the check_relocs routine.  Take a look at
elf_i386_check_relocs, or other check_relocs routines; you'll see that
they happily add various dynamic sections as required by the
relocation entries.  Have it call
    bfd_elf32_link_create_dynamic_sections
or something along those lines.

I just realized that there is confusion about create_dynamic_sections:
functions by that name exist in both elflink.c and elflink.h.  I'm not
sure how that happened.

Ian

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