Menu

#24 Error on compile - multiple definition of `_init'

v1.6
open
nobody
5
2009-09-30
2009-09-30
Oleg S.
No

Compiling for kernel 2.6.18-164.el5
make -C /lib/modules/2.6.18-164.el5/build M=/root/distr/netflow/ipt_netflow modules
make[1]: Entering directory `/usr/src/kernels/2.6.18-164.el5-x86_64'
CC [M] /root/distr/netflow/ipt_netflow/ipt_NETFLOW.o
Building modules, stage 2.
MODPOST
CC /root/distr/netflow/ipt_netflow/ipt_NETFLOW.mod.o
LD [M] /root/distr/netflow/ipt_netflow/ipt_NETFLOW.ko
make[1]: Leaving directory `/usr/src/kernels/2.6.18-164.el5-x86_64'
gcc -O2 -Wall -Wunused -I/lib/modules/2.6.18-164.el5/build/include -I/root/distr/iptables/iptables-1.3.5/include -DIPTABLES_V
ERSION=\"1.3.5\" -fPIC -o libipt_NETFLOW_sh.o -c libipt_NETFLOW.c
gcc -shared -o libipt_NETFLOW.so libipt_NETFLOW_sh.o
libipt_NETFLOW_sh.o: In function `_init':
libipt_NETFLOW.c:(.text+0x30): multiple definition of `_init'
/usr/lib/gcc/x86_64-redhat-linux/4.1.2/../../../../lib64/crti.o:(.init+0x0): first defined here
collect2: ld returned 1 exit status
make: *** [libipt_NETFLOW.so] Error 1

------------

Discussion

  • Oleg S.

    Oleg S. - 2009-09-30
    • summary: Error on compile --> Error on compile - multiple definition of `_init'
     
  • Nobody/Anonymous

    Пытался собрать ipt_netflow версии 1.6 под CentOS 5 и столкнулся с проблемой, модуль для ядра собирался прекрасно, а вот модуль для iptables выдавал ошибку.

    Лечится правкой libipt_NETFLOW.c

    -void _init(void)
    +void __attribute((constructor)) my_init(void)

    Собственно после этого все работает на ура !

    Инфу взял отсюда http://centos.alt.ru/?p=290 , проверил работает

     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.