From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.org/gmane.linux.lib.musl.general/13473 Path: news.gmane.org!.POSTED!not-for-mail From: Szabolcs Nagy Newsgroups: gmane.linux.lib.musl.general Subject: Re: Question regarding dynamic loader Date: Wed, 21 Nov 2018 17:41:56 +0100 Message-ID: <20181121164156.GP21289@port70.net> References: <20181121142550.GA23599@brightrain.aerifal.cx> Reply-To: musl@lists.openwall.com NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: blaine.gmane.org 1542818408 29156 195.159.176.226 (21 Nov 2018 16:40:08 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Wed, 21 Nov 2018 16:40:08 +0000 (UTC) User-Agent: Mutt/1.10.1 (2018-07-13) Cc: dalias@libc.org, Gernot Reisinger To: musl@lists.openwall.com Original-X-From: musl-return-13489-gllmg-musl=m.gmane.org@lists.openwall.com Wed Nov 21 17:40:04 2018 Return-path: Envelope-to: gllmg-musl@m.gmane.org Original-Received: from mother.openwall.net ([195.42.179.200]) by blaine.gmane.org with smtp (Exim 4.84_2) (envelope-from ) id 1gPVXm-0007P8-Ea for gllmg-musl@m.gmane.org; Wed, 21 Nov 2018 17:40:02 +0100 Original-Received: (qmail 24085 invoked by uid 550); 21 Nov 2018 16:42:08 -0000 Mailing-List: contact musl-help@lists.openwall.com; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-ID: Original-Received: (qmail 24067 invoked from network); 21 Nov 2018 16:42:08 -0000 Mail-Followup-To: musl@lists.openwall.com, dalias@libc.org, Gernot Reisinger Content-Disposition: inline In-Reply-To: Xref: news.gmane.org gmane.linux.lib.musl.general:13473 Archived-At: * Gernot Reisinger [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.