This is the mail archive of the
binutils@sourceware.cygnus.com
mailing list for the binutils project.
Re: Interesting issue
- To: law at cygnus dot com
- Subject: Re: Interesting issue
- From: Ian Lance Taylor <ian at zembu dot com>
- Date: 15 Oct 1999 15:40:29 -0400
- CC: binutils at sourceware dot cygnus dot com
- References: <32714.939931502@upchuck.cygnus.com>
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