-
Notifications
You must be signed in to change notification settings - Fork 275
libxt_coova: Use constructor instead of _init() #556
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
The _init() function collides with a _init() function in crti.o. This results in the following error in OpenWrt: arc-openwrt-linux-gnu/bin/ld: libxt_coova.o: in function `_init': /lib/gcc/arc-openwrt-linux-gnu/11.3.0/crti.o:(.init+0x4): first defined here collect2: error: ld returned 1 exit status make[7]: *** [Makefile:22: libxt_coova.so] Error 1 Fix this by suing a constructor attribute instead. This function will still be called after the shared library was loaded. Fixes: coova#553 Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
ea0f3d0 to
0fc3761
Compare
|
I was wondering if the correct fix for this is actually to change the function signature from "Each library must register to the running ip6tables (or iptables) program by calling Unfortunately, I don't have OpenWRT setup to test, can you try making the following change and report back? |
|
I see No idea if both are desired to be honest. Having it static would probably result in an unused function warning. edit: ah disregard that. edit2: I tried the static version. No unused function warning. |
|
I was wrong edit: xtables.h has all the logic hidden behind a define. Which is probably why it doesn't work: |
The _init() function collides with a _init() function in crti.o.
This results in the following error in OpenWrt:
arc-openwrt-linux-gnu/bin/ld: libxt_coova.o: in function `_init':
/lib/gcc/arc-openwrt-linux-gnu/11.3.0/crti.o:(.init+0x4): first defined here
collect2: error: ld returned 1 exit status
make[7]: *** [Makefile:22: libxt_coova.so] Error 1
Fix this by suing a constructor attribute instead. This function will
still be called after the shared library was loaded.
Fixes: #553
Signed-off-by: Hauke Mehrtens hauke@hauke-m.de