public inbox for gas2@sourceware.org
 help / color / mirror / Atom feed
* Re: ld, ld.so and -symbolic
       [not found] <199506170044.RAA29582@www.willows.com>
@ 1995-06-17 13:09 ` H.J. Lu
  1995-06-18  3:40   ` Paul Kranenburg
  1995-06-18 10:16   ` Roland McGrath
  0 siblings, 2 replies; 4+ messages in thread
From: H.J. Lu @ 1995-06-17 13:09 UTC (permalink / raw)
  To: Rob Farnum; +Cc: Ken Raeburn, gas2, Ian Lance Taylor, Eric Youngdale

> 
> This may not be the right place to ask, but before I go off talking to the
> gnu people, I thought I'd start here specifically as this is an elf issue.  
> 
> The question has to do with the -symbolic option that gcc man pages say is
> a linker option, but ld does not seem to support.  My understanding on sun
> solaris is that the -Bsymbolic option  allows me to have two, or more, shared 
> objects that can have there own global variables, that won't conflict with 
> other variables of the same name.  The question I have is, is this supported,
> can it be supported, when, how, how much?
> 

I would like to see that is supported in ld. How hard
is it? I don't think that should be very hard. Am I
wrong?

-- 
H.J. Lu
NYNEX Science and Technology, Inc.			hjl@nynexst.com


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

* Re: ld, ld.so and -symbolic
  1995-06-17 13:09 ` ld, ld.so and -symbolic H.J. Lu
@ 1995-06-18  3:40   ` Paul Kranenburg
  1995-06-18  8:14     ` H.J. Lu
  1995-06-18 10:16   ` Roland McGrath
  1 sibling, 1 reply; 4+ messages in thread
From: Paul Kranenburg @ 1995-06-18  3:40 UTC (permalink / raw)
  To: gas2

> > The question has to do with the -symbolic option that gcc man pages say is
> > a linker option, but ld does not seem to support.  My understanding on sun
> > solaris is that the -Bsymbolic option  allows me to have two, or more, shared 
> > objects that can have there own global variables, that won't conflict with 
> > other variables of the same name.  The question I have is, is this supported,
> > can it be supported, when, how, how much?

You'd have to make sure that 1) all symbols get resolved, i.e. no
references to undefined remain in the shared object, and 2) all
remaining relocation records are of the type "relative to load address".
The latter is a hard requirement if you have to bootstrap a la "ld.so".

You'll need to have a library handy from which you can pull in all
required PIC modules, e.g. say "libc_pic.a" (in stead of "libc.so.x.y").

-pk

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

* Re: ld, ld.so and -symbolic
  1995-06-18  3:40   ` Paul Kranenburg
@ 1995-06-18  8:14     ` H.J. Lu
  0 siblings, 0 replies; 4+ messages in thread
From: H.J. Lu @ 1995-06-18  8:14 UTC (permalink / raw)
  To: Paul Kranenburg; +Cc: gas2

> 
> > > The question has to do with the -symbolic option that gcc man pages say is
> > > a linker option, but ld does not seem to support.  My understanding on sun
> > > solaris is that the -Bsymbolic option  allows me to have two, or more, shared 
> > > objects that can have there own global variables, that won't conflict with 
> > > other variables of the same name.  The question I have is, is this supported,
> > > can it be supported, when, how, how much?
> 
> You'd have to make sure that 1) all symbols get resolved, i.e. no
> references to undefined remain in the shared object, and 2) all
> remaining relocation records are of the type "relative to load address".
> The latter is a hard requirement if you have to bootstrap a la "ld.so".
> 
> You'll need to have a library handy from which you can pull in all
> required PIC modules, e.g. say "libc_pic.a" (in stead of "libc.so.x.y").
> 

Are we talking about the same thing? BTW, you don't have to use
-Bsymbolic when you build ld.so.

-- 
H.J. Lu
NYNEX Science and Technology, Inc.			hjl@nynexst.com
-----
    -B symbolic  In dynamic mode only, when  building  a  shared
                 object,  bind  references  to  global symbols to
                 their definitions within the object, if  defini-
                 tions  are  available.   Normally, references to
                 global symbols within  shared  objects  are  not
                 bound  until  runtime,  even  if definitions are
                 available, so that definitions of the same  sym-
                 bol in an executable or other shared objects can
                 override the object's own definition.   ld  will
                 issue  warnings  for undefined symbols unless -z
                 defs overrides.



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

* Re: ld, ld.so and -symbolic
  1995-06-17 13:09 ` ld, ld.so and -symbolic H.J. Lu
  1995-06-18  3:40   ` Paul Kranenburg
@ 1995-06-18 10:16   ` Roland McGrath
  1 sibling, 0 replies; 4+ messages in thread
From: Roland McGrath @ 1995-06-18 10:16 UTC (permalink / raw)
  To: hjl; +Cc: robf, raeburn, gas2, ian, eric

In ELF there is a simple feature that if a DT_SYMBOLIC element appears in a
shared object's dynamic section, then when resolving references within that
shared object, the dynamic linker will give that object's own definitions
first precedence, followed by the executable and other loaded shared
objects (the normal order being the executable followed by all loaded
shared objects).  I believe GNU ld already has a -symbolic switch that
creates the DT_SYMBOLIC element when building a shared object (though I
could be mistaken).


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

end of thread, other threads:[~1995-06-18 10:16 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <199506170044.RAA29582@www.willows.com>
1995-06-17 13:09 ` ld, ld.so and -symbolic H.J. Lu
1995-06-18  3:40   ` Paul Kranenburg
1995-06-18  8:14     ` H.J. Lu
1995-06-18 10:16   ` Roland McGrath

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).