[Android Q&A, Help & Troubleshooting] buraktamturk:
Hello,

I am losing my mind while building ipset binary to android, i am worked on it at least two hours, i have successfully builded kernel module for ipset, it is working fine but i cannot run ipset binary on my device. (nexus 5)

PKG_CONFIG_PATH=/storage/android/lib/pkgconfig CC=/storage/arm-linux-gnueabi-linaro_4.9.1-2014.06/bin/arm-eabi-cc ./configure --with-kmod=no --enable-shared=no --host=arm-linux-gnueabi --prefix=/storage/android

With this configuration command, ipset builds fine, but when i push it to /system/bin/ipset, i can not execute it from here.

/system/bin # ./ipset
/sbin/sh: ./ipset: not found

readelf -hd ipset output

ELF Header:
Magic: 7f 45 4c 46 01 01 01 00 00 00 00 00 00 00 00 00
Class: ELF32
Data: 2's complement, little endian
Version: 1 (current)
OS/ABI: UNIX - System V
ABI Version: 0
Type: EXEC (Executable file)
Machine: ARM
Version: 0x1
Entry point address: 0x92a1
Start of program headers: 52 (bytes into file)
Start of section headers: 365580 (bytes into file)
Flags: 0x5000202, has entry point, Version5 EABI, soft-float ABI
Size of this header: 52 (bytes)
Size of program headers: 32 (bytes)
Number of program headers: 8
Size of section headers: 40 (bytes)
Number of section headers: 38
Section header string table index: 35

Dynamic section at offset 0x171e0 contains 25 entries:
Tag Type Name/Value
0x00000001 (NEEDED) Shared library: [libdl.so.2]
0x00000001 (NEEDED) Shared library: [libc.so.6]
0x0000000c (INIT) 0x8b98
0x0000000d (FINI) 0x1038c
0x00000019 (INIT_ARRAY) 0x271d4
0x0000001b (INIT_ARRAYSZ) 4 (bytes)
0x0000001a (FINI_ARRAY) 0x271d8
0x0000001c (FINI_ARRAYSZ) 4 (bytes)
0x00000004 (HASH) 0x818c
0x00000005 (STRTAB) 0x86ec
0x00000006 (SYMTAB) 0x831c
0x0000000a (STRSZ) 576 (bytes)
0x0000000b (SYMENT) 16 (bytes)
0x00000015 (DEBUG) 0x0
0x00000003 (PLTGOT) 0x272d0
0x00000002 (PLTRELSZ) 440 (bytes)
0x00000014 (PLTREL) REL
0x00000017 (JMPREL) 0x89e0
0x00000011 (REL) 0x89c8
0x00000012 (RELSZ) 24 (bytes)
0x00000013 (RELENT) 8 (bytes)
0x6ffffffe (VERNEED) 0x89a8
0x6fffffff (VERNEEDNUM) 1
0x6ffffff0 (VERSYM) 0x892c
0x00000000 (NULL) 0x0

readelf -hd iptables output (the one that comes with android, works fine)

ELF Header:
Magic: 7f 45 4c 46 01 01 01 00 00 00 00 00 00 00 00 00
Class: ELF32
Data: 2's complement, little endian
Version: 1 (current)
OS/ABI: UNIX - System V
ABI Version: 0
Type: DYN (Shared object file)
Machine: ARM
Version: 0x1
Entry point address: 0x5348
Start of program headers: 52 (bytes into file)
Start of section headers: 223636 (bytes into file)
Flags: 0x5000000, Version5 EABI
Size of this header: 52 (bytes)
Size of program headers: 32 (bytes)
Number of program headers: 8
Size of section headers: 40 (bytes)
Number of section headers: 27
Section header string table index: 26

Dynamic section at offset 0x32cec contains 26 entries:
Tag Type Name/Value
0x00000003 (PLTGOT) 0x33e44
0x00000002 (PLTRELSZ) 864 (bytes)
0x00000017 (JMPREL) 0x4a00
0x00000014 (PLTREL) REL
0x00000011 (REL) 0x1080
0x00000012 (RELSZ) 14720 (bytes)
0x00000013 (RELENT) 8 (bytes)
0x6ffffffa (RELCOUNT) 1835
0x00000015 (DEBUG) 0x0
0x00000006 (SYMTAB) 0x148
0x0000000b (SYMENT) 16 (bytes)
0x00000005 (STRTAB) 0x8c8
0x0000000a (STRSZ) 1098 (bytes)
0x00000004 (HASH) 0xd14
0x00000001 (NEEDED) Shared library: [libc.so]
0x00000001 (NEEDED) Shared library: [libm.so]
0x00000001 (NEEDED) Shared library: [libstdc++.so]
0x00000020 (PREINIT_ARRAY) 0x33c6c
0x00000021 (PREINIT_ARRAYSZ) 0x8
0x00000019 (INIT_ARRAY) 0x33c74
0x0000001b (INIT_ARRAYSZ) 8 (bytes)
0x0000001a (FINI_ARRAY) 0x33c7c
0x0000001c (FINI_ARRAYSZ) 8 (bytes)
0x0000001e (FLAGS) BIND_NOW
0x6ffffffb (FLAGS_1) Flags: NOW
0x00000000 (NULL) 0x0

I think the problem is libraries, i also pushed the libc.so.6 and libdl to /system/lib with no success.

Could someone point out where i am doing the mistake?

Thanks.