Question

I read this article (http://qasim.zaidi.me/2009/05/overriding-system-call-in-aix.html;) about overriding a systemcall in aix;

I wrote two kernel extensions just like the article said "The first kernel extension would merely re-export the original system call with a different name. The second, will actually override the syscall by redefining it, and then call the original one as exported by the first module."

But there is a error when I make the second extension:

1> gcc -O2 -maix64 -ffreestanding -o my_syscall.o -c my_syscall.c -D_KERNEL
1> ld -b64 -o my_syscall my_syscall.o -e my_syscall_init -bI:/home/rabbitte/output/test_system/my_syscall.exp -bI:/usr/lib/kernex.exp -lsys -lcsys 
1>ld : 0711-224 warning : Duplicate symbol: .getpid
1> ld: 0711-345 Use the -bloadmap or -bnoquiet option to obtain more information.

The file "/home/rabbitte/output/test_system/my_syscall.exp" is the export file of the first extension. I don't understand the what the "Duplicate symbol: .getpid" means. Could you tell me how to solve this problem?

Thanks very much.

No correct solution

OTHER TIPS

The reason is that the file “kernex.exp” also include the symbol “getpid”. I should comment the getpid in file kernex.exp.

I've never done any of this, so this might not be sufficient to solve your problem, but your linker line has two -bI options. It should be -bI for the AIX kernex.exp, and -bE for your exp file according to the docs you point to.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top