From owner-freebsd-arch@FreeBSD.ORG Thu Aug 14 16:13:30 2014 Return-Path: Delivered-To: freebsd-arch@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 3435BC23 for ; Thu, 14 Aug 2014 16:13:30 +0000 (UTC) Received: from mail-ig0-f171.google.com (mail-ig0-f171.google.com [209.85.213.171]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E8B4D2B03 for ; Thu, 14 Aug 2014 16:13:29 +0000 (UTC) Received: by mail-ig0-f171.google.com with SMTP id l13so14059021iga.4 for ; Thu, 14 Aug 2014 09:13:28 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:sender:content-type:mime-version:subject:from :in-reply-to:date:cc:message-id:references:to; bh=le4Q5q/klF/D/+OLRdK5XUcD/ZYpZMGgzhUYlwa1d0Y=; b=kFzO/wuiIHMNLAmg53ymmzbXa5xmGndQrv0E6h2fSoC+uZzmNSwKy9uqJxQkUM0MOG 86wldFs/mWTGP5gZgiaeXejto78rsW+rcPe5xeQFQvNc6Qx6gDYU4ZPTQoERQQc36OrJ XcgOWP0WbMxBXX65Q5zJ0xn1lUkVP0cSE/ZVecHNRnt52Yb2uJnLeeP8Fj6pU6prfy+v vA5wSFnGC5fvl9BH5Yn6Lpl+B4ngbAWx97Ahj9g2jiTdBrWRAhTr7bgnPg8cJx4LoEaH xaQZR7SfSuj6fHDODRf1LGN9y8mHChOz6qH6y6gUJY/vNARccCxZLHmROgXGL8PauOPx Byqg== X-Gm-Message-State: ALoCoQmFOk/uvuku7HCBfm/PvtMP3iOfUZa9/Gnl7GltHeZgBsHgfhCvqGjN+DbY4O1vF6KOrrBj X-Received: by 10.42.26.74 with SMTP id e10mr15247060icc.25.1408032808733; Thu, 14 Aug 2014 09:13:28 -0700 (PDT) Received: from netflix-mac.bsdimp.com (50-78-194-198-static.hfc.comcastbusiness.net. [50.78.194.198]) by mx.google.com with ESMTPSA id ro8sm21739789igb.15.2014.08.14.09.13.27 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 14 Aug 2014 09:13:27 -0700 (PDT) Sender: Warner Losh Content-Type: multipart/signed; boundary="Apple-Mail=_DFC22E69-B2C2-435F-A022-562FF05965DC"; protocol="application/pgp-signature"; micalg=pgp-sha512 Mime-Version: 1.0 (Mac OS X Mail 7.3 \(1878.6\)) Subject: Re: XML Output: libxo - provide single API to output TXT, XML, JSON and HTML From: Warner Losh In-Reply-To: <201408140847.00573.jhb@freebsd.org> Date: Thu, 14 Aug 2014 10:13:26 -0600 Message-Id: <94A47A7D-89C9-4504-B669-2A5EDA80373B@bsdimp.com> References: <20140814052648.GM2737@kib.kiev.ua> <201408140606.s7E66XXA091972@idle.juniper.net> <20140814085257.GN2737@kib.kiev.ua> <201408140847.00573.jhb@freebsd.org> To: John Baldwin X-Mailer: Apple Mail (2.1878.6) Cc: Marcel Moolenaar , Phil Shafer , John-Mark Gurney , "Simon J. Gerraty" , arch@freebsd.org, Poul-Henning Kamp , freebsd-arch , 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:13:30 -0000 --Apple-Mail=_DFC22E69-B2C2-435F-A022-562FF05965DC Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=windows-1252 On Aug 14, 2014, at 6:47 AM, John Baldwin wrote: >>> 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? >>=20 >> 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 ? >>=20 >> 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 ? >=20 > Yes, checking DT_NEEDED for libxo.so is the first thing I thought of = as well. =20 > It is equivalent to 'ldd foo | grep libxo'. Doesn=92t work for static binaries, nor for cases where libxo is linked = in by a library indirectly, nor for when the command is a shell script that may invoke a command that supports this output, nor for a python script that implements this output, etc. My question for people advocating this method: Why not require all = commands that generate this kind of output to support a standard command line = option that causes the command to print nothing and return 0 if it supports = reporting, or anything else if it doesn=92t (return 0 with output, or return = non-zero with or without output). This would handle the more complicated implementation issues = with using DT_NEEDED and/or the ELF note, be more in line with how things are = traditionally done, and offer greater flexibility of implementation. Warner --Apple-Mail=_DFC22E69-B2C2-435F-A022-562FF05965DC Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=signature.asc Content-Type: application/pgp-signature; name=signature.asc Content-Description: Message signed with OpenPGP using GPGMail -----BEGIN PGP SIGNATURE----- Comment: GPGTools - https://gpgtools.org iQIcBAEBCgAGBQJT7OAmAAoJEGwc0Sh9sBEAEPQQAJLliSBIX1ZOzojPmD3OMQjX JydNjyQxCL/8e9nwp3DbAJT3jdSuJCLNaPcyUr+9+bq49NNCGhHunyE6ORTewJRB Mn59lTRdrjNs1xFB8ZWjBuJgiWdMIyu14z9TJChm7x2wiTIjxW0bDJVfWlaGfVSU iYF+v039ethCGvHBEIFrX4nuovIqehMrcen1nnSd3MjjMSm3Q4/BZQpANpfmWVwN R2yjZkFG2YbfdxmlpRoAIMePHHcpAO3wD3UYTV0kcjHixFtkvJ3fGcdG6cowV17Q E9b3UkjbqrMmRuR+O+BzIBKepFzNmrSfmawwXxnGTU8wOhpWkSEaO6y0egtkNPCw KFYyaTspL0DjEY2jfsEw0sPqfMiexMV6qLivHQ+vNMFNJZIcE20mCJ3EhTXyW9FC 7PWoneU4L3v/QjsPmIlfwgule7rq+nuucCMPBFM4wzvegL7fZfr7gHw1VrUTScIy lKiQkD4Th+CTzGpmdj2p9EdmN9Us9Q7ZSBrTji8VyfDB+lIjtMcBzsaO6MeXiQjV Uh6M3O6O4yl8/PkTGbohQhyugJeTqN5S1hc9Y0yl+ui0q868WbW77LcSjU0DAV23 ou726heAes/0NuYgCdnwY8skV1lTX8CUVDhsCOy4x+1Fp725RPniafRr2MlqAgYl +04+85NTYfZOtHUZKmou =e42H -----END PGP SIGNATURE----- --Apple-Mail=_DFC22E69-B2C2-435F-A022-562FF05965DC--