From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 4428 invoked by alias); 18 Dec 2008 22:03:03 -0000 Received: (qmail 4416 invoked by uid 22791); 18 Dec 2008 22:03:02 -0000 X-SWARE-Spam-Status: No, hits=-1.7 required=5.0 tests=AWL,BAYES_00,SARE_MSGID_LONG40,SPF_PASS X-Spam-Check-By: sourceware.org Received: from wf-out-1314.google.com (HELO wf-out-1314.google.com) (209.85.200.169) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 18 Dec 2008 22:02:24 +0000 Received: by wf-out-1314.google.com with SMTP id 28so657428wfc.24 for ; Thu, 18 Dec 2008 14:02:22 -0800 (PST) Received: by 10.143.7.5 with SMTP id k5mr995554wfi.176.1229637742304; Thu, 18 Dec 2008 14:02:22 -0800 (PST) Received: by 10.142.114.9 with HTTP; Thu, 18 Dec 2008 14:02:22 -0800 (PST) Message-ID: <74fef6df0812181402n1debced5xbe3f402a3a34ecf2@mail.gmail.com> Date: Thu, 18 Dec 2008 22:03:00 -0000 From: "Mathieu Lacage" To: "Mathieu Lacage" , gdb@sourceware.org Subject: Re: how to make gdb happy with my linkmap In-Reply-To: <20081218214854.GA7706@caradoc.them.org> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <74fef6df0812181341x8ecdd31me028bd4d658384b1@mail.gmail.com> <20081218214854.GA7706@caradoc.them.org> X-IsSubscribed: yes Mailing-List: contact gdb-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sourceware.org X-SW-Source: 2008-12/txt/msg00085.txt.bz2 On Thu, Dec 18, 2008 at 10:48 PM, Daniel Jacobowitz wrote: > On Thu, Dec 18, 2008 at 10:41:20PM +0100, Mathieu Lacage wrote: >> hi, >> >> I am currently trying to write a small ELF loader and make gdb be >> happy with it. > > On SVR4 systems, basically, you can't. There is some information you > won't be able to update because it lives in the kernel (auxilliary > vector). This is one of the reasons I recently implemented "set erm, I might be totally naive, but, how does the libc loader achieve this then ? The only thing I am trying to do is be sufficiently compatible with the libc loader to make gdb happy with my loader. Did I mention that I am trying to replace the libc loader rather than try to make two loaders co-exist in the same process image (which would create another set of challenging problems from a compatibility perspective). > wrapper"; if the loader is far enough along when GDB starts looking will grep for this. > at it, and has a link map already set up, then it will (generally) > not go poking around the auxilliary vector. > >> Hence, my question: what are the requirements on the structure of a >> linkmap which is compatible with gdb's usage (beyond the mere ABI >> offset requirements). > > I don't think this is possible to answer. The answer is that GDB is > written to work as best it can with all the system loaders we've > encountered. If there's a change that would make things easier for > your loader, without breaking any of those systems, you're welcome to > propose it :-) Ok, my question then, is: what can I do in my loader to be fully compatible with what gdb expects :) I am willing to go through quite a bit of pain in the name of compatibility: whatever gdb asks me to do will be probably orders of magnitude easier than what glibc is asking me to provide Mathieu -- Mathieu Lacage