From: Gernot Reisinger <Gernot.Reisinger@omnino.at>
To: musl@lists.openwall.com, dalias@libc.org
Subject: Re: Question regarding dynamic loader
Date: Fri, 23 Nov 2018 12:34:17 +0100 [thread overview]
Message-ID: <CALsoeq=eKqt9C956RERxEkVXLTDKnSQz7e7rD=2wL5-kjOHyWg@mail.gmail.com> (raw)
In-Reply-To: <20181121164156.GP21289@port70.net>
[-- Attachment #1: Type: text/plain, Size: 1203 bytes --]
Thanks a lot for this exhaustive explanation - helps a lot to understand
the different initialization stages. I agree, one should not assume a
specific execution sequence of these initialization routines.
Am Mi., 21. Nov. 2018 um 17:41 Uhr schrieb Szabolcs Nagy <nsz@port70.net>:
> * Gernot Reisinger <Gernot.Reisinger@omnino.at> [2018-11-21 16:52:53
> +0100]:
> > I did no extensive research how glibc executes these constructor calls.
> At
> > least the call stack indicates that they are partially executed in
> dynamic
> > linker context - _dl_start_user () in /lib64/ld-linux-x86-64.so
> > calling _dl_init.
>
> the dynamic linker runs the
> - preinit_array functions of the main executable,
> - the init_array and DT_INIT functions of shared libraries.
>
> then via __libc_start_main the _init and init_array functions
> of the main executable are run by libc_nonshared.a code that
> is linked into the executable.
>
> so part of the initialization (main exe) does require entry
> via __libc_start_main (but this is not an issue for go).
>
> however this design can change when glibc introduces a new
> symbol version for __libc_start_main, so i don't see how
> go can rely on any of this.
>
>
[-- Attachment #2: Type: text/html, Size: 1618 bytes --]
next prev parent reply other threads:[~2018-11-23 11:34 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-11-21 13:55 Gernot Reisinger
2018-11-21 14:25 ` Rich Felker
2018-11-21 15:52 ` Gernot Reisinger
2018-11-21 16:41 ` Szabolcs Nagy
2018-11-23 11:34 ` Gernot Reisinger [this message]
2018-11-21 16:14 ` Rich Felker
2018-11-21 14:46 ` Szabolcs Nagy
2018-11-23 9:29 ` Florian Weimer
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='CALsoeq=eKqt9C956RERxEkVXLTDKnSQz7e7rD=2wL5-kjOHyWg@mail.gmail.com' \
--to=gernot.reisinger@omnino.at \
--cc=dalias@libc.org \
--cc=musl@lists.openwall.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.
Code repositories for project(s) associated with this public inbox
https://git.vuxu.org/mirror/musl/
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 NNTP newsgroup(s).