[CFT] Importing NetBSD's vis/unvis(3)

Brooks Davis brooks at freebsd.org
Fri Dec 14 16:45:44 UTC 2012


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.
> 
> > The ABI of unvis changes slightly so I've added a compatibility shim for
> > it.
> 
> 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.
> 
> > http://people.freebsd.org/~brooks/patches/vis.diff
> 
> > [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[] = {
> > +	{ "AElig",	198 }, /* capital AE diphthong (ligature)  */
> > +	{ "Aacute",	193 }, /* capital A, acute accent  */
> > +	{ "Acirc",	194 }, /* capital A, circumflex accent  */
> > [snip]
> > +};
> 
> Please avoid adding 100 relative relocations, for example by changing
> const char *name to char name[7].
> 
> 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
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 188 bytes
Desc: not available
URL: <http://lists.freebsd.org/pipermail/freebsd-arch/attachments/20121214/5d184eeb/attachment.sig>


More information about the freebsd-arch mailing list