????? ???????????? wrote: > Roger, > do you remember the use case which required to add NODIRECT to environ > and _environ in > http://src.opensolaris.org/source/xref/onnv/onnv-gate/usr/src/lib/libc/sparc/mapfile-vers? > I am trying to understand why environ was marked as NODIRECT but > getenv/putenv/setenviron were not.
Through historic (and ABI) requirements, the crt files that the compiler adds to an applications link-edit contain a variety of symbol definitions. These symbols are also defined in libc. The crt's define things like "environ" (compile an application with LD_OPTIONS=-Dsymbols,details and you can observe the symbols each input file contributes). Because of these duplicate definitions, and the expectation that all references should really resolve to the same symbol, the symbol definitions within libc have been tagged as NODIRECT. This tagging prevents libc from binding to it's own definitions when those from a crt are present. The functions that manipulate environ, getenv/putenv/setenviron are only defined on libc, and thus are left as direct binding candidates, even from libc itself. -- Rod Everybody to Everest! April 2010, I'll climb to Mt. Everest Base Camp as a fund raiser for The Challenged Athletes Foundation - www.everybodytoeverest.com. Visit www.everestchallenge.kintera.org/rie to show your support. Thanks!