mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 00:27:45 +00:00
Tests/LibELF: Test loading libraries with dynamic TLS
The setup is a bit peculiar: both the definition and the use site of these TLS variables have to be in a shared library, otherwise the linker might relax the global-dynamic access mode to something that doesn't require a `__tls_get_addr` call.
This commit is contained in:
parent
ad9e674fa0
commit
c63fe0e1f1
4 changed files with 106 additions and 6 deletions
16
Tests/LibELF/TestTLS.cpp
Normal file
16
Tests/LibELF/TestTLS.cpp
Normal file
|
@ -0,0 +1,16 @@
|
|||
/*
|
||||
* Copyright (c) 2023, Daniel Bertalan <dani@danielbertalan.dev>
|
||||
*
|
||||
* SPDX-License-Identifier: BSD-2-Clause
|
||||
*/
|
||||
|
||||
#include <LibTest/TestCase.h>
|
||||
|
||||
// When linking an executable, TLS relaxations might be relaxed to different
|
||||
// access modes than intended. Hence, the actual logic has been moved to a
|
||||
// shared library, and this executable just calls it.
|
||||
extern void run_test();
|
||||
TEST_CASE(basic)
|
||||
{
|
||||
run_test();
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue