I am using buildroot to build tun.c kernel module (tun/tap kernel module) for Linux kernel 2.6.33. I customised the buildroot for the appropriate architecture and ELF flags. When I compile user mode program like:
int main()
{
printf("hello world\n");
return 0;
}
by issuing the command:
make ARCH=mips CROSS_COMPILE=my_cross_compiler_path
One of the readelf output of the binary is flags 0x50001007, noreorder, pic, cpic,o32, mips32
I did the same for cross compiling tun.c and I got tun.ko. This time I got different ELF flags - I got 0x50001001, noreorder, o32, mips32
How do I cross compile tun.c with the suit ELF flags?