Hello everyone,
If a C function is described as "extern inline", gcc doesn't make
the function's name visible to the linker, and it becomes unresolved.
I'm writing a Linux driver, and I'm testing it via insmod/rmmod commands
(to avoid re-linking the kernel every time I make a change). Any attempt
to use insmod causes bunch of "Undefined feference" messages
about functions that are described as "extern inline" in
asm/uaccess.h file (for example, __put_user_asm).
If we remove "extern" keyword then everything works.
Has anyone run into the same problem? Is it a real problem, or maybe
I'm just doing somethign wrong ?
Thank you,
Lev.
--
Below is the simplest reproduction (terminal output):
pgmldp@vmlnx02:~/test > cat test123.c
/*
* Testing of "extern inline" combination.
*/
#include <stdio.h>
void init(void);
extern inline void start123(void)
{
printf("test123 is starting\n");
}
int main(void)
{
start123();
}
pgmldp@vmlnx02:~/test > gcc -o test123 test123.c
/tmp/cc4rNl3D.o: In function `main':
/tmp/cc4rNl3D.o(.text+0x8): undefined reference to `start123'
collect2: ld returned 1 exit status
pgmldp@vmlnx02:~/test > uname -a
Linux vmlnx02 2.4.7-SuSE-SMP #1 SMP Wed Oct 17 15:31:03 GMT 2001 s390 unknown