PATCH: Mark __dso_handle hidden
H.J. Lu
hjl.tools@gmail.com
Thu Jun 16 18:17:00 GMT 2011
On Thu, Jun 16, 2011 at 11:04 AM, Ulrich Drepper <drepper@gmail.com> wrote:
> On Thu, Jun 16, 2011 at 09:15, H.J. Lu <hjl.tools@gmail.com> wrote:
>> On another platform, bad atexit implementation called from DSO caused
>> weird run-time problems. The same problem can happen with glibc. The
>> worse thing can happen with my patch is people will old compilers will
>> get a link-time error, instead of strange run-time problems.
>
> No. If there is no __dso_handle symbol the reference is NULL and
> therefore atexit can work nicely when used in programs. It doesn't
> work in DSOs but that was always the case before the introduction of
> __dso_handle.
>
> You didn't say why you wanted this change to happen. Just because of
> this minute code improvement? That's not really a reason to
> potentially break some situations.
>
The result of calling such atexit from DSO is weird run-time
problems, ranging from crash to incorrect result. My patch
will prevent that. As for link-time failure my patch introduces
with the older compilers, the work around is very trivial.
--
H.J.
More information about the Libc-alpha
mailing list