From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Andy Wingo Newsgroups: gmane.lisp.guile.devel Subject: Re: thinking out loud: wip-rtl, ELF, pages, and mmap Date: Sun, 28 Apr 2013 14:45:11 +0200 Message-ID: <87y5c2ddt4.fsf@pobox.com> References: <874nevhe4a.fsf@pobox.com> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1367153120 29539 80.91.229.3 (28 Apr 2013 12:45:20 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 28 Apr 2013 12:45:20 +0000 (UTC) To: guile-devel Original-X-From: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Sun Apr 28 14:45:24 2013 Return-path: Envelope-to: guile-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1UWQyp-0005ql-F4 for guile-devel@m.gmane.org; Sun, 28 Apr 2013 14:45:23 +0200 Original-Received: from localhost ([::1]:48631 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UWQyp-0005Ee-1s for guile-devel@m.gmane.org; Sun, 28 Apr 2013 08:45:23 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:60032) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UWQyi-0005EO-US for guile-devel@gnu.org; Sun, 28 Apr 2013 08:45:19 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UWQyh-0005oo-QM for guile-devel@gnu.org; Sun, 28 Apr 2013 08:45:16 -0400 Original-Received: from a-pb-sasl-quonix.pobox.com ([208.72.237.25]:49901 helo=sasl.smtp.pobox.com) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UWQyh-0005og-MM for guile-devel@gnu.org; Sun, 28 Apr 2013 08:45:15 -0400 Original-Received: from sasl.smtp.pobox.com (unknown [127.0.0.1]) by a-pb-sasl-quonix.pobox.com (Postfix) with ESMTP id A1123BA9C for ; Sun, 28 Apr 2013 08:45:14 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=pobox.com; h=from:to :subject:references:date:in-reply-to:message-id:mime-version :content-type; s=sasl; bh=37+8/Q2Y+1igdJ/euGP9Ci0IUo8=; b=EcY2ag SBrOqMLUxOwznCQ4RyuwdlTJ2Qk9YsGh8dITCTCmtwBI7yu1SNyMxwPCJ1hBEVpp rkD3UZmH69ptYL+ekaFCofERaQvnEKJDUU+WoRimniJLQhk93hqG/P8jlSlUqj+B aNAj+N37TsKEmG8l4+2nywUnyFtT8sz4KyPqI= DomainKey-Signature: a=rsa-sha1; c=nofws; d=pobox.com; h=from:to:subject :references:date:in-reply-to:message-id:mime-version :content-type; q=dns; s=sasl; b=olk/h1ORwjBm+vNCkhsTmVT7//XXZr7J y5GCdT/qh4KlSk/CEA7HriqPJxvESGeD71uKLqOC0vmTZHjiy5MyxNDu5eFlkjL/ KCRfxjl02S4lLfgN3PKPjaLTxQMz9Y0mAAHqeSQSEApJH84occV+rX3mFVZcaXUN ik6ud/7oQpw= Original-Received: from a-pb-sasl-quonix.pobox.com (unknown [127.0.0.1]) by a-pb-sasl-quonix.pobox.com (Postfix) with ESMTP id 9A059BA9B for ; Sun, 28 Apr 2013 08:45:14 -0400 (EDT) Original-Received: from badger (unknown [88.160.190.192]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by a-pb-sasl-quonix.pobox.com (Postfix) with ESMTPSA id 26D33BA9A for ; Sun, 28 Apr 2013 08:45:14 -0400 (EDT) In-Reply-To: <874nevhe4a.fsf@pobox.com> (Andy Wingo's message of "Wed, 24 Apr 2013 22:23:33 +0200") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.2 (gnu/linux) X-Pobox-Relay-ID: 78CED2FA-B001-11E2-8F97-C8310E5B5709-02397024!a-pb-sasl-quonix.pobox.com X-detected-operating-system: by eggs.gnu.org: Solaris 10 X-Received-From: 208.72.237.25 X-BeenThere: guile-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Developers list for Guile, the GNU extensibility library" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Original-Sender: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.lisp.guile.devel:16299 Archived-At: Hi, On Wed 24 Apr 2013 22:23, Andy Wingo writes: > I'll change the linker to always emit sections and segments that > correspond exactly in their on-disk layout and in their in-memory > layout. (In ELF terms: segments are contiguous, with p_memsz == > p_filesz.) I'll put commonly needed things at the beginning, and > debugging info and the section table at the end. Then I'll just map > the whole thing with PROT_READ, and set PROT_WRITE on those > page-aligned segments that need it. (Obviously in the future, > PROT_EXEC as well.) > > Then I'll just record a list of ELF objects that have been loaded. I've done this now. If you are on wip-rtl, you will need to recompile all of your .go files, as the loader now checks for these constraints. > Simple bisection will map IP -> ELF, and from there we have the section > table in memory (lazily paged in by the virtual memory system) and can > find the symtab and other debug info. I haven't done this yet, but at this point we can do it in Scheme I think. Regards, Andy -- http://wingolog.org/