From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.org/gmane.linux.lib.musl.general/4939 Path: news.gmane.org!not-for-mail From: "writeonce@midipix.org" Newsgroups: gmane.linux.lib.musl.general Subject: _start(ldso) & _start(crt) Date: Mon, 21 Apr 2014 15:41:23 -0400 Message-ID: <53557463.2050202@midipix.org> Reply-To: musl@lists.openwall.com NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1398109305 11563 80.91.229.3 (21 Apr 2014 19:41:45 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 21 Apr 2014 19:41:45 +0000 (UTC) To: musl@lists.openwall.com Original-X-From: musl-return-4943-gllmg-musl=m.gmane.org@lists.openwall.com Mon Apr 21 21:41:38 2014 Return-path: Envelope-to: gllmg-musl@plane.gmane.org Original-Received: from mother.openwall.net ([195.42.179.200]) by plane.gmane.org with smtp (Exim 4.69) (envelope-from ) id 1WcK5x-0002aI-D7 for gllmg-musl@plane.gmane.org; Mon, 21 Apr 2014 21:41:37 +0200 Original-Received: (qmail 23795 invoked by uid 550); 21 Apr 2014 19:41:36 -0000 Mailing-List: contact musl-help@lists.openwall.com; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: Original-Received: (qmail 23781 invoked from network); 21 Apr 2014 19:41:36 -0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.4.0 Xref: news.gmane.org gmane.linux.lib.musl.general:4939 Archived-At: Greetings, When running a dynamically linked program, the general control flow is _start(ldso/{arch}/start.s) --> __dynlink --> _start(crt) --> __libc_start_main --> main() When asking gdb to set up a breakpoint at _start (b _start), gdb's confirmation message shows the address of _start(crt), but it then breaks at _start(ldso), which is actually what I want. It then later also breaks at _start(crt). If gdb decided to only break at the executable's _start, then I believe there would be no way to request a break at the interpreter's (ldso) _start routine, since the address of ldso's _start is not known prior to execution. I am not sure whether this is a good-enough motivation to rename ldso's start to _ldso_start (and set libc.so's entry point accordingly), or whether we could simply count on gdb and other debuggers to continue to do the "right thing" by breaking at the earlier _start of the two. For one thing, setting a breakpoint at __dynlink provides pretty much the same debugging ability as with _start(ldso), and does not require any changes. Any thoughts? Kind regards, zg