public inbox for libc-hacker@sourceware.org
 help / color / mirror / Atom feed
From: David Mosberger <davidm@napali.hpl.hp.com>
To: Roland McGrath <roland@redhat.com>
Cc: davidm@hpl.hp.com, libc-hacker@sources.redhat.com, hjl@lucon.org
Subject: Re: patch to make init_array work (2nd version; resend)
Date: Thu, 07 Nov 2002 13:51:00 -0000	[thread overview]
Message-ID: <15818.57443.807212.759018@napali.hpl.hp.com> (raw)
In-Reply-To: <200211072131.gA7LVdj28886@magilla.sf.frob.com>

>>>>> On Thu, 7 Nov 2002 13:31:39 -0800, Roland McGrath <roland@redhat.com> said:

  Roland> Your dl-fini.c fix is obviously correct and I put that in.

Great!  Thanks a lot!

  Roland> None of the messages I have seen from you or HJ have
  Roland> mentioned what the problem being fixed by HJ's changes was,
  Roland> so I had to look at the whole thing for a while to figure
  Roland> out what the point was.  (The arrays are already processed
  Roland> properly in loaded objects, but not in the executable
  Roland> itself.)  Now that I see the problem, I can at least put in
  Roland> those test cases.

Sorry, I think neither HJ nor I were trying to be cryptic.  Yes, the
main problem is indeed that .init_array/.fini_array don't get called
for the main program (though HJ's patch obviously address other things
as well, such as correcting the order of .fini_array calls and adding
test case).

  Roland> I don't like HJ's implementation, which introduces three new
  Roland> relocs in libc.so with weak references to symbols defined in
  Roland> crt1.o.  That's just nasty.  The simple thing would be to
  Roland> pass more arguments to __libc_start_main, which would
  Roland> require versioning.

  Roland> But I think that, in keeping with the convention that its
  Roland> own .init/.fini are the executable's problem, it would be
  Roland> cleanest for the arrays just to be handled by the existing
  Roland> init/fini functions in the executable.  That is, have the
  Roland> single function pair it passes (now _init/_fini) do all the
  Roland> work.  My first thought was to just put the code into
  Roland> crti.o/crtn.o, but this code should not go into shared
  Roland> libraries.

OK, I _think_ I understand your concern.  Perhaps we could just change
the platform-specific start.S to pass a different _init/_fini function
which takes care of calling init_array/fini_array?  If you think that
would work, I can take a stab at doing that for
sysdeps/ia64/elf/start.S.

Thanks,

	--david

  reply	other threads:[~2002-11-07 21:51 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-11-07 11:43 David Mosberger
2002-11-07 13:31 ` Roland McGrath
2002-11-07 13:51   ` David Mosberger [this message]
2002-11-07 13:58     ` Roland McGrath
2002-11-07 14:10       ` David Mosberger
2002-11-07 14:29         ` Roland McGrath
2002-11-07 14:38           ` David Mosberger
2002-11-07 18:10       ` Richard Henderson
2002-11-07 18:20         ` Roland McGrath
2002-11-07 18:30           ` David Mosberger
2002-11-07 18:45             ` Roland McGrath
2002-11-08 11:34 Roland McGrath
2002-11-08 11:38 ` David Mosberger

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=15818.57443.807212.759018@napali.hpl.hp.com \
    --to=davidm@napali.hpl.hp.com \
    --cc=davidm@hpl.hp.com \
    --cc=hjl@lucon.org \
    --cc=libc-hacker@sources.redhat.com \
    --cc=roland@redhat.com \
    /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).