From owner-freebsd-arch@FreeBSD.ORG Fri Dec 14 16:45:44 2012 Return-Path: Delivered-To: freebsd-arch@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id B1D92C2B for ; Fri, 14 Dec 2012 16:45:44 +0000 (UTC) (envelope-from brooks@lor.one-eyed-alien.net) Received: from lor.one-eyed-alien.net (lor.one-eyed-alien.net [69.66.77.232]) by mx1.freebsd.org (Postfix) with ESMTP id 109628FC13 for ; Fri, 14 Dec 2012 16:45:42 +0000 (UTC) Received: from lor.one-eyed-alien.net (localhost [127.0.0.1]) by lor.one-eyed-alien.net (8.14.5/8.14.5) with ESMTP id qBEGjaDW072341; Fri, 14 Dec 2012 10:45:36 -0600 (CST) (envelope-from brooks@lor.one-eyed-alien.net) Received: (from brooks@localhost) by lor.one-eyed-alien.net (8.14.5/8.14.5/Submit) id qBEGja3j072340; Fri, 14 Dec 2012 10:45:36 -0600 (CST) (envelope-from brooks) Date: Fri, 14 Dec 2012 10:45:36 -0600 From: Brooks Davis To: Jilles Tjoelker Subject: Re: [CFT] Importing NetBSD's vis/unvis(3) Message-ID: <20121214164536.GH40927@lor.one-eyed-alien.net> References: <20121211202925.GA40927@lor.one-eyed-alien.net> <20121214134652.GB89880@stack.nl> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="ZYOWEO2dMm2Af3e3" Content-Disposition: inline In-Reply-To: <20121214134652.GB89880@stack.nl> User-Agent: Mutt/1.5.21 (2010-09-15) Cc: freebsd-arch@freebsd.org X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 14 Dec 2012 16:45:44 -0000 --ZYOWEO2dMm2Af3e3 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri, Dec 14, 2012 at 02:46:52PM +0100, Jilles Tjoelker wrote: > On Tue, Dec 11, 2012 at 02:29:25PM -0600, Brooks Davis wrote: > > As part of importing NetBSD's mtree I need to add more vis(3) API > > functions from NetBSD. The easiest path seems to be a wholesale import > > of their code with the addition of VIS_GLOB support for compatibility. > > The attached patch accomplishes this. Please review or test. >=20 > > The ABI of unvis changes slightly so I've added a compatibility shim for > > it. >=20 > Looks like NetBSD changed it such that it cannot be kept compatible this > time, by using vis(3) flags for unvis(3) which must collide with our old > unvis(3) flags. Are you agreeing that the shim is required or hinting that I got it wrong? > > Note that old files must be removed in addition to applying the patch so > > Make finds the right files. >=20 > > http://people.freebsd.org/~brooks/patches/vis.diff >=20 > > [snip] > > diff -ruN contrib/libc-vis/unvis.c contrib/libc-vis/unvis.c > > --- contrib/libc-vis/unvis.c 1969-12-31 18:00:00.000000000 -0600 > > +++ contrib/libc-vis/unvis.c 2012-10-20 09:22:09.000000000 -0500 > > @@ -0,0 +1,562 @@ > > [snip] > > +/* > > + * RFC 1866 > > + */ > > +static const struct nv { > > + const char *name; > > + uint8_t value; > > +} nv[] =3D { > > + { "AElig", 198 }, /* capital AE diphthong (ligature) */ > > + { "Aacute", 193 }, /* capital A, acute accent */ > > + { "Acirc", 194 }, /* capital A, circumflex accent */ > > [snip] > > +}; >=20 > Please avoid adding 100 relative relocations, for example by changing > const char *name to char name[7]. >=20 > RTLD will have to adjust 100 pointers for the load address of libc.so.7, > and even in a static library the pointers take up a disproportionate > amount of space. I'll submit a patch for this upstream. Thanks, Brooks --ZYOWEO2dMm2Af3e3 Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.11 (FreeBSD) iD8DBQFQy1evXY6L6fI4GtQRAs2NAJ95PXUm41riZGNdx+0FMqiu3d4O1gCg43QC SS12Ad9L9TVhjc+OE0mw0gY= =Hf3D -----END PGP SIGNATURE----- --ZYOWEO2dMm2Af3e3--