public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
From: Richard Henderson <rth@cygnus.com>
To: law@cygnus.com
Cc: m9305357@bohm.anu.edu.au, egcs@cygnus.com
Subject: Re: Shared C++ libs on i386-pc-solaris2.5.1
Date: Thu, 11 Sep 1997 13:20:00 -0000	[thread overview]
Message-ID: <199709111955.MAA20955@rtl.cygnus.com> (raw)
In-Reply-To: <4912.873994065@hurl.cygnus.com>

> On some systems (PAs running hpux), you can't have a text/readonly data
> item which is initialized to the address of another item.
> 
> ie
> 
> 	.word foo
> 
> isn't valid if it's going into the text or readonly data section.

This is not the case on an i386 ELF system.

In the main application there is a nasty hack called .dynbss which the
linker creates to hold all of the variable references.  So the symbols
are really at constant addresses, and have their contents filled in at
run time.  (It is odeious and breaks when symbol sizes (read arrays)
change.)

A shared library, on the other hand, is tagged with DT_TEXTREL which
tells the loader that it should temporarily remap everything read-write.
Thus, while outputting read-only data that contains relocactions should
be avoided (because of the mprotect penalty), it does function correctly.

All this is if course how things are _supposed_ to work.  If you've got
a broken loader on some system...


r~

  reply	other threads:[~1997-09-11 13:20 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <199709100139.SAA07609@cygnus.com>
1997-09-09 19:54 ` James Macnicol
1997-09-10 22:37 ` James Macnicol
1997-09-11 10:01   ` Jeffrey A Law
1997-09-11 13:20     ` Richard Henderson [this message]
1997-09-07  5:42 James Macnicol
1997-09-07 10:11 ` H.J. Lu
     [not found] <34096EF5.5768EC4F@student.anu.edu.au>
1997-09-04 15:05 ` Jim Wilson
1997-09-04 16:55   ` Jeffrey A Law
  -- strict thread matches above, loose matches on Subject: below --
1997-08-31  2:07 egcs 970828 and X11 on linux/x86 H.J. Lu
1997-08-31 13:17 ` Shared C++ libs on i386-pc-solaris2.5.1 James Macnicol

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=199709111955.MAA20955@rtl.cygnus.com \
    --to=rth@cygnus.com \
    --cc=egcs@cygnus.com \
    --cc=law@cygnus.com \
    --cc=m9305357@bohm.anu.edu.au \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).