Skip to content

Commit ebf17b0

Browse files
explcily export functions from module
1 parent 3139a1c commit ebf17b0

2 files changed

Lines changed: 4 additions & 2 deletions

File tree

include/module.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,8 @@ typedef struct elf_rela {
127127
typedef bool (*module_init_fn)(void); /**< Prototype for module initialiser */
128128
typedef void (*module_exit_fn)(void); /**< Prototype for module finaliser */
129129

130+
#define EXPORTED __attribute__((visibility("default")))
131+
130132
/**
131133
* @brief Describes a loaded and relocated module image
132134
*

modules/test/test.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
#include <kernel.h>
22

3-
bool mod_init(void) {
3+
bool EXPORTED mod_init(void) {
44
dprintf("test.ko: mod_init called!\n");
55
return true;
66
}
77

8-
void mod_exit(void) {
8+
void EXPORTED mod_exit(void) {
99
dprintf("test.ko: mod_exit called!\n");
1010
}

0 commit comments

Comments
 (0)