Skip to content

Commit

Permalink
libxt_coova: Use constructor instead of _init()
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
hauke committed Aug 15, 2022
1 parent 65f0920 commit 0fc3761
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/linux/libxt_coova.c
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ static struct xtables_match coova_mt6_reg = {
.extra_opts = coova_opts,
};

void _init(void)
void __attribute__ ((constructor)) xtables_init(void)
{
xtables_register_match(&coova_mt_reg);
xtables_register_match(&coova_mt6_reg);
Expand Down

0 comments on commit 0fc3761

Please sign in to comment.