[PATCH] BZ #14545: Always check dtv before freeing dtv[-1]

Roland McGrath roland@hack.frob.com
Thu Sep 6 23:12:00 GMT 2012


> I don't see how
> 
> #ifndef SHARED
> # define EXTERN extern
> # define GL(name) _##name
> #else
> 
> #ifndef SHARED
> # define _dl_initial_dtv ((void *) &_dl_static_dtv[1])
> #endif
> 
> will work since GL(dl_initial_dtv)) will be expanded to
> -(void *) &_dl_static_dtv[1]).

Huh?  Did you try it?

GL(dl_initial_dtv) becomes _dl_initial_dtv and then that
becomes ((void *) &_dl_static_dtv[1]).  No problem.

Even translating what I presume were your typos to:
  _((void *) &_dl_static_dtv[1])
your expectation of that result indicates either a misunderstanding of
cpp semantics so thorough I can't quite imagine what you think they are,
or just a braino.



More information about the Libc-alpha mailing list