[PATCH] Unconditionally define __stack_chk_guard [BZ #26817]
Fāng-ruì Sòng
maskray@google.com
Mon Jan 11 17:40:13 GMT 2021
On Mon, Jan 11, 2021 at 1:39 AM Florian Weimer <fweimer@redhat.com> wrote:
>
> * Fangrui Song via Libc-alpha:
>
> > This makes -mstack-protector-guard=global work even if
> > -mstack-protector-guard=tls is the default.
>
> It's unclear how you intend this to work. Is it just for building
> glibc? Or also for user code?
It is for user applications.
gcc -fstack-protector -mstack-protector-guard=global a.c
or
clang -fstack-protector -mstack-protector-guard=global a.c (clang 12)
Currently there is an undefined symbol error. This patch fixes the problem.
> In the latter case, we either need to provide a way to initialize a
> hidden __stack_chk_guard symbol (probably with new relocations), or
> export __stack_chk_guard from glibc, under a GLIBC_2.33 symbol version
> for architectures that were missing it before.
In elf/Versions, __stack_chk_guard is already exported as
__stack_chk_guard@@GLIBC_2.4
> Thanks,
> Florian
> --
> Red Hat GmbH, https://de.redhat.com/ , Registered seat: Grasbrunn,
> Commercial register: Amtsgericht Muenchen, HRB 153243,
> Managing Directors: Charles Cachera, Brian Klemm, Laurie Krebs, Michael O'Neill
>
More information about the Libc-alpha
mailing list