glibc/csu
Adhemerval Zanella e82aab227b csu: Disable stack protector for static-reloc for static-pie
For instance on x86_64 with gcc 12.1.1 andwith fstack-protector
enabled the empty function still generates a stack protector code
sequence:

  0000000000000000 <_dl_relocate_static_pie>:
     0:   48 83 ec 18             sub    $0x18,%rsp
     4:   64 48 8b 04 25 28 00    mov    %fs:0x28,%rax
     b:   00 00
     d:   48 89 44 24 08          mov    %rax,0x8(%rsp)
    12:   31 c0                   xor    %eax,%eax
    14:   48 8b 44 24 08          mov    0x8(%rsp),%rax
    19:   64 48 2b 04 25 28 00    sub    %fs:0x28,%rax
    20:   00 00
    22:   75 05                   jne    29 <_dl_relocate_static_pie+0x29>
    24:   48 83 c4 18             add    $0x18,%rsp
    28:   c3                      ret
    29:   e8 00 00 00 00          call   2e <_dl_relocate_static_pie+0x2e>

And since the function is called prior thread pointer setup, it
triggers a invalid memory access (this is shown with the failure
of elf/tst-tls1-static-non-pie).

Although it might characterizes as compiler issue or missed
optimization, to be safe also disables stack protector on
static-reloc object.

Checked on x86_64-linux-gnu and sparc64-linux-gnu.
Reviewed-by: Siddhesh Poyarekar <siddhesh@sourceware.org>
2022-10-06 12:52:46 -03:00
..
abi-note.c Update copyright dates with scripts/update-copyrights 2022-01-01 11:40:24 -08:00
check_fds.c Update copyright dates with scripts/update-copyrights 2022-01-01 11:40:24 -08:00
dso_handle.c Update copyright dates with scripts/update-copyrights 2022-01-01 11:40:24 -08:00
errno-loc.c Update copyright dates with scripts/update-copyrights 2022-01-01 11:40:24 -08:00
errno.c Update copyright dates with scripts/update-copyrights 2022-01-01 11:40:24 -08:00
gmon-start.c Update copyright dates with scripts/update-copyrights 2022-01-01 11:40:24 -08:00
init-first.c Update copyright dates with scripts/update-copyrights 2022-01-01 11:40:24 -08:00
init.c Update copyright dates with scripts/update-copyrights 2022-01-01 11:40:24 -08:00
libc-start.c Remove kernel version check 2022-05-16 15:03:49 -03:00
libc-tls.c csu: Implement and use _dl_early_allocate during static startup 2022-05-16 18:42:03 +02:00
Makefile csu: Disable stack protector for static-reloc for static-pie 2022-10-06 12:52:46 -03:00
rtld-sizes.sym
start.c
static-reloc.c Update copyright dates with scripts/update-copyrights 2022-01-01 11:40:24 -08:00
sysdep.c
version.c Remove kernel version check 2022-05-16 15:03:49 -03:00
Versions