I'm trying to build an shared library on Windows with MinGW, follow this tutorial: Building_elf_shared_libraries
I run this step:
$ gcc -fPICenter code here -c libfoo.c -o libfoo.o
$ gcc -Wall -O2 -shared -Wl,-soname,libfoo.so.1 -o libfoo.so.1.0.0 libfoo.o
When I get the .so I try to read it with readelf and get error:
$ readelf -h libfoo.so.1.0.0
readelf: Error: Not an ELF file - it has the wrong magic bytes at the start
Did I misunderstand something?