Demos: Add "DynamicObjectDemo" to demo the dynamic loader

This commit is contained in:
Itamar 2020-10-10 18:26:16 +03:00 committed by Andreas Kling
commit 09ccdc697b
Notes: sideshowbarker 2024-07-19 00:51:37 +09:00
7 changed files with 101 additions and 1 deletions

View file

@ -0,0 +1,20 @@
#include "../lib.h"
int func();
__thread int g_tls1 = 0;
__thread int g_tls2 = 0;
static void init_function() __attribute__((constructor));
void init_function()
{
g_tls1 = 1;
g_tls2 = 2;
}
int func()
{
return 3;
}