mirror of
https://github.com/fergalmoran/ladybird.git
synced 2026-01-08 09:35:15 +00:00
Demos: Add "DynamicObjectDemo" to demo the dynamic loader
This commit is contained in:
20
Demos/DynamicObject/SampleLib/lib.cpp
Normal file
20
Demos/DynamicObject/SampleLib/lib.cpp
Normal 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;
|
||||
}
|
||||
Reference in New Issue
Block a user