Otherwise loading a dynamically linked libc with rseq support fails,
as result of the __rseq_abi TLS variable, which has an alignment
of 32 bytes.
Reviewed-by: Carlos O'Donell <carlos@redhat.com>
Tested-by: Vineet Gupta <vgupta@synopsys.com>
Reviewed-by: Alistair Francis <alistair.francis@wdc.com>
Tested-by: Alistair Francis <alistair.francis@wdc.com>
size_t tcb_offset;
const ElfW(Phdr) *phdr;
+ /* libc.so with rseq has TLS with 32-byte alignment. Static dlopen
+ requires at least 32-byte alignment as well, otherwise loading
+ libc.so will always fail. */
+ if (max_align < 32)
+ max_align = 32;
+
struct link_map *main_map = GL(dl_ns)[LM_ID_BASE]._ns_loaded;
/* Look through the TLS segment if there is any. */