[hurd,commited] hurd: Avoid more libc.so local PLTs
Zack Weinberg
zackw@panix.com
Tue Apr 3 22:33:00 GMT 2018
On Tue, Apr 3, 2018 at 6:27 PM, Samuel Thibault
<samuel.thibault@ens-lyon.org> wrote:
> Zack Weinberg, on mar. 03 avril 2018 18:21:10 -0400, wrote:
>> On Tue, Apr 3, 2018 at 5:55 PM, Samuel Thibault
>> <samuel.thibault@ens-lyon.org> wrote:
>> > H.J. Lu, on mar. 03 avril 2018 14:41:27 -0700, wrote:
>> >> On Tue, Apr 3, 2018 at 2:24 PM, Samuel Thibault
>> >> <samuel.thibault@ens-lyon.org> wrote:
>> >> > H.J. Lu, on mar. 03 avril 2018 14:16:50 -0700, wrote:
>> >> >> On Tue, Apr 3, 2018 at 2:07 PM, Samuel Thibault
>> >> >> <samuel.thibault@ens-lyon.org> wrote:
>> >> >> > Hello,
>> >> >> >
>> >> >> > H.J. Lu, on mar. 03 avril 2018 12:26:33 -0700, wrote:
>> >> >> >> __libc_longjmp and __libc_siglongjmp are private external functions provided for
>> >> >> >> libpthread. They should never be called inside libc.
>> >> >> >
>> >> >> > I'm sorry for asking, but are these conventions documented somewhere?
>> >> >> > These look like magic to me otherwise:
>> >> >>
>> >> >> I don't believe they are well documented.
>> >> >
>> >> > Ok, then I need an answer to my question:
>> >> >
>> >> >> > why shouldn't they ever be called from libc?
>> >> >
>> >> > The existing hurd code does use them for catching signals, so I need to
>> >> > know how to fix it.
>> >>
>> >> Use something similar to
>> >>
>> >> libc_hidden_proto (_setjmp)
>> >> libc_hidden_proto (__sigsetjmp)
>> >
>> > So I'd just add hidden protos & defs to longjmp and siglongjmp?
>>
>> Right, except it has to be the __ variety for siglongjmp because that
>> function is not in C89.
>
> Yes, but longjmp and siglong are only used in functions which are part
> of _GNU_SOURCE, and longjmp only for fork(), so that implies their
> presence, right?
>
> (I would have already gotten the link namespace warning otherwise).
Joseph would know better than me, but I _think_ it's still necessary
to avoid using the application-namespace names. For instance, a
program that uses fork, but not siglongjmp, might have defined its own
siglongjmp -- this actually isn't that farfetched if you consider
things like gnulib (and I do know of a few cases where gnulib will
override a glibc function with its own implementation).
zw
More information about the Libc-alpha
mailing list