From owner-freebsd-arch@FreeBSD.ORG Thu Aug 14 16:07:14 2014 Return-Path: Delivered-To: freebsd-arch@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 5A1DF24D; Thu, 14 Aug 2014 16:07:14 +0000 (UTC) Received: from bigwig.baldwin.cx (bigwig.baldwin.cx [IPv6:2001:470:1f11:75::1]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2EEE729A4; Thu, 14 Aug 2014 16:07:14 +0000 (UTC) Received: from jhbbsd.localnet (unknown [209.249.190.124]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id F225AB922; Thu, 14 Aug 2014 12:07:12 -0400 (EDT) From: John Baldwin To: freebsd-arch@freebsd.org Subject: Re: XML Output: libxo - provide single API to output TXT, XML, JSON and HTML Date: Thu, 14 Aug 2014 08:47:00 -0400 User-Agent: KMail/1.13.5 (FreeBSD/8.4-CBSD-20140415; KDE/4.5.5; amd64; ; ) References: <20140814052648.GM2737@kib.kiev.ua> <201408140606.s7E66XXA091972@idle.juniper.net> <20140814085257.GN2737@kib.kiev.ua> In-Reply-To: <20140814085257.GN2737@kib.kiev.ua> MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-15" Content-Transfer-Encoding: 7bit Message-Id: <201408140847.00573.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Thu, 14 Aug 2014 12:07:13 -0400 (EDT) Cc: marcel@freebsd.org, Phil Shafer , John-Mark Gurney , "Simon J. Gerraty" , arch@freebsd.org, Poul-Henning Kamp , Konstantin Belousov X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 Aug 2014 16:07:14 -0000 On Thursday, August 14, 2014 4:52:57 am Konstantin Belousov wrote: > On Thu, Aug 14, 2014 at 02:06:33AM -0400, Phil Shafer wrote: > > Konstantin Belousov writes: > > >Yes, the notes are used to communicate the information required by > > >the dynamic linker to correctly activate the image. The mechanism has > > >nothing to do with application-specific features, and overloading it for > > >that purpose is severe and pointless layering violation. > > > > The ELF spec says: > > > > Note Section > > > > Sometimes a vendor or system builder needs to mark an object > > file with special information that other programs will check > > for conformance, compatibility, etc. Sections of type SHT_NOTE > > and program header elements of type PT_NOTE can be used for > > this purpose. The note information in sections and program > > header elements holds any number of entries, each of which is > > an array of 4-byte words in the format of the target processor. > > Labels appear below to help explain note information organization, > > but they are not part of the specification. > ELF standard scope is about build toolchain and C runtime, where the > cited paragraph makes perfect sense. Agreed. > > Marking the binary with a libxo-specific note tells the caller that > > the binary is capable of rendering its output in a non-traditional > > style and gives the caller a means of triggering those styles of > > output. In the libxo-enabled world, I see this as vital information > > the caller needs to initialize the environment in which the command > > will be run. Isn't this exactly the sort of information ELF targets > > for note sections? > > How binary format has any relevance for an application level feature ? > What would you do with the binaries which permissions are 'r-s--x--x', > which is not unexpected for the tools which gather system information > and have to access things like /dev/mem ? > > You removed and did not answered a crusial question, which is a litmus > test for your proposal. Namely, how presence of the proposed note in > the binary is different from DT_NEEDED tag for your library ? Yes, checking DT_NEEDED for libxo.so is the first thing I thought of as well. It is equivalent to 'ldd foo | grep libxo'. -- John Baldwin