public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
* Interesting issue
@ 1999-10-14 11:46 Jeffrey A Law
  1999-10-14 12:37 ` Ian Lance Taylor
  0 siblings, 1 reply; 5+ messages in thread
From: Jeffrey A Law @ 1999-10-14 11:46 UTC (permalink / raw)
  To: binutils

As some of you know I've been beating on PA64 ELF tools for hpux11; I've
basically got them working (including a PA64 linker, shared library support,
and all the usual bells and whistles).

One of the outstanding problems is "static linking" on hpux11 really just
means use .a libraries instead of .sl libraries -- we still need to create
dynamic sections & relocs and all the stuff we do for dynamic links.

The problem (of course) is -static for gld means really do a static link,
no .dynamic section or dynamic relocs, etc etc etc.

Any particularly insightful thoughts on how to make this work?  Anyone else
ever had to do something similar for another braindamaged system?

jeff

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Interesting issue
  1999-10-14 11:46 Interesting issue Jeffrey A Law
@ 1999-10-14 12:37 ` Ian Lance Taylor
  1999-10-14 13:07   ` Jeffrey A Law
  0 siblings, 1 reply; 5+ messages in thread
From: Ian Lance Taylor @ 1999-10-14 12:37 UTC (permalink / raw)
  To: law; +Cc: binutils

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

   One of the outstanding problems is "static linking" on hpux11 really just
   means use .a libraries instead of .sl libraries -- we still need to create
   dynamic sections & relocs and all the stuff we do for dynamic links.

   The problem (of course) is -static for gld means really do a static link,
   no .dynamic section or dynamic relocs, etc etc etc.

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.

Ian

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Interesting issue
  1999-10-14 12:37 ` Ian Lance Taylor
@ 1999-10-14 13:07   ` Jeffrey A Law
  1999-10-15 12:41     ` Ian Lance Taylor
  0 siblings, 1 reply; 5+ messages in thread
From: Jeffrey A Law @ 1999-10-14 13:07 UTC (permalink / raw)
  To: Ian Lance Taylor; +Cc: binutils

  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?

jeffv

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Interesting issue
  1999-10-14 13:07   ` Jeffrey A Law
@ 1999-10-15 12:41     ` Ian Lance Taylor
  1999-10-15 13:39       ` Jeffrey A Law
  0 siblings, 1 reply; 5+ messages in thread
From: Ian Lance Taylor @ 1999-10-15 12:41 UTC (permalink / raw)
  To: law; +Cc: binutils

   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

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Interesting issue
  1999-10-15 12:41     ` Ian Lance Taylor
@ 1999-10-15 13:39       ` Jeffrey A Law
  0 siblings, 0 replies; 5+ messages in thread
From: Jeffrey A Law @ 1999-10-15 13:39 UTC (permalink / raw)
  To: Ian Lance Taylor; +Cc: binutils

  In message < 19991015194029.9107.qmail@daffy.airs.com >you write:
  > 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.
Ah yes.  Silly me, I spent time in the check_relocs hook ;I should have
been able to figure that one out.  This should be exactly what I need.
Thanks.


  > 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.
Joys :(

jeff

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~1999-10-15 13:39 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1999-10-14 11:46 Interesting issue Jeffrey A Law
1999-10-14 12:37 ` Ian Lance Taylor
1999-10-14 13:07   ` Jeffrey A Law
1999-10-15 12:41     ` Ian Lance Taylor
1999-10-15 13:39       ` Jeffrey A Law

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).