1// This file is to secure memory space just after %fs register.
2
3constexpr int TLS_SPACE_FOR_LOADEE = 4096;
4thread_local unsigned char sloader_dummy_to_secure_tls_space[TLS_SPACE_FOR_LOADEE] = {0, 0, 0, 0};
5unsigned long sloader_tls_offset = 4096;
6
7void write_sloader_dummy_to_secure_tls_space() {
8 sloader_dummy_to_secure_tls_space[0] = 0xaa;
9 sloader_dummy_to_secure_tls_space[1] = 0xaa;
10 sloader_dummy_to_secure_tls_space[2] = 0xaa;
11 sloader_dummy_to_secure_tls_space[3] = 0xaa;
12 sloader_dummy_to_secure_tls_space[TLS_SPACE_FOR_LOADEE - 4] = 0xab;
13 sloader_dummy_to_secure_tls_space[TLS_SPACE_FOR_LOADEE - 3] = 0xcd;
14 sloader_dummy_to_secure_tls_space[TLS_SPACE_FOR_LOADEE - 2] = 0xab;
15 sloader_dummy_to_secure_tls_space[TLS_SPACE_FOR_LOADEE - 1] = 0xcd;
16}
17