tech-userlevel archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: resolver function namespace protection



On Wed, Dec 10, 2014 at 12:05:32PM -0500, Christos Zoulas wrote:
 > I propose though that we go one (or two) steps further, and remove
 > the defines from <resolv.h>, and put them in libc/include/namespace.h
 > with all the rest of the renamed symbols as the second step. This is
 > desirable because it unclutters resolv.h and puts all the renamed
 > symbols in one place (or at least one place that I know of).

That is probably a good idea. Although, there's something to be said
for not exposing e.g. "res_ninit" from libc at all if programs haven't
included the right headers to be allowed to see it.

Beating up autoconf with a sledgehammer also seems like a fine idea to
me. :-/  I wonder if it would make sense actually to take the same
steps with older symbols from resolv.h and tag the unrenamed ones with
ERROR_REFERENCES; unfortunately we can't get rid of them entirely for
compat, but this would at least allow finding and fixing all the code
that's doing things wrong.

 > As a third (optional step), I propose that we move all the
 > __weak_aliases() from the libc c files, and autogenerate them into
 > a single c file. This way, in the future if we decide to get rid
 > of them for a different mechanism (like symbol renames) this will
 > become easier.

I think in ELF weak aliases have to be in the same .o as their
targets, so it won't work.

-- 
David A. Holland
dholland%netbsd.org@localhost


Home | Main Index | Thread Index | Old Index