~tim/dlopen_test

dlopen_test/lib.c -rw-r--r-- 305 bytes View raw
c647d1a7Tim Morgan Add unlicense 1 year, 6 months ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
#include "stdio.h"

// https://gcc.gnu.org/onlinedocs/gcc/Common-Function-Attributes.html
// gcc only? what happens with clang?
void __attribute__ ((constructor)) lib_loaded(void);

void lib_loaded(void) {
  printf("hello from lib_loaded\n");
}

void lib_func(void) {
  printf("hello from lib_func\n");
}