From owner-freebsd-toolchain@FreeBSD.ORG Sun Feb 19 08:03:00 2012 Return-Path: Delivered-To: freebsd-toolchain@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 75F1A106567A; Sun, 19 Feb 2012 08:03:00 +0000 (UTC) (envelope-from draco@marino.st) Received: from shepard.synsport.net (mail.synsport.com [208.69.230.148]) by mx1.freebsd.org (Postfix) with ESMTP id 4CD878FC0C; Sun, 19 Feb 2012 08:02:59 +0000 (UTC) Received: from [192.168.0.11] (atoulouse-256-1-26-95.w90-38.abo.wanadoo.fr [90.38.109.95]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by shepard.synsport.net (Postfix) with ESMTP id 89CCA438BD; Sun, 19 Feb 2012 02:02:58 -0600 (CST) Message-ID: <4F40ACB4.8000103@marino.st> Date: Sun, 19 Feb 2012 09:03:00 +0100 From: John Marino User-Agent: Mozilla/5.0 (Windows NT 5.1; rv:9.0) Gecko/20111222 Thunderbird/9.0.1 MIME-Version: 1.0 To: Konstantin Belousov References: <4F3C5A3A.6050107@FreeBSD.org> <20120216154730.GL3283@deviant.kiev.zoral.com.ua> <4F3D3409.3040006@marino.st> <20120216202709.GQ3283@deviant.kiev.zoral.com.ua> <4F3F4AE2.30203@marino.st> <20120218213832.GL3283@deviant.kiev.zoral.com.ua> In-Reply-To: <20120218213832.GL3283@deviant.kiev.zoral.com.ua> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: kan@freebsd.org, Pedro Giffuni , freebsd-toolchain@freebsd.org Subject: Re: DragonFly added support for ELF preinit, init, and fini arrays X-BeenThere: freebsd-toolchain@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Maintenance of FreeBSD's integrated toolchain List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 19 Feb 2012 08:03:00 -0000 On 2/18/2012 10:38 PM, Konstantin Belousov wrote: > > Thank you, it was very useful. It seems that test4 needed some adjustments > to actually provide the required dso for tests. Yeah. I thought I gave you a version that worked out of the box but I did modify this test as well. > Now, the patch at http://people.freebsd.org/~kib/misc/init_array.2.patch > passes your tests and allows to boot world built with pre-patched csu > into multiuser mode. > > I decided to move the calls to initializers for main binary into rtld, > and used the brand note to distinguish old and new csu. I assume the purpose of this is to have a clean split with static initialization done in crt1 and dynamic initialization done entirely in rtld for binaries built with version 100009 and later. Does the note digestion used to check osrel add significant overhead? Is not this information already available via aux_vectors passed on from imgact_elf.c? > > ATM patch is only for i386 and amd64, I will port to other architectures > after some feedback. It's out of scope of your current work but related to notes, but there's another test that DragonFly passes that FreeBSD fails. If memory serves, it was caused by the PT_NOTE segment getting located outside of the first page the majority of the time starting with binutils 2.21. http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/9d35f29fb5dd669d4e04521b39296e5bdf14b2b0 A related problem was an interpret segment outside of the first page: http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/99aed3e43ef052664173110d6db3ddf6a62e375b Both of these were handled within sys/kern/imgact_elf.c John