Unable to printf floating point numbers from executable shared library
I'm developing a shared library which can be executed independently to print it's own version number. I've defined a custom entry point as: const char my_interp[] __attribute__((section(".interp"))) = "/lib64/ld-linux-x86-64.so.2"; void my_main() { printf("VERSION: %d\n", 0); _exit(0); } and I compile with gcc -o list.os -c -g -Wall -fPIC list.c gcc -o liblist.so -g -Wl,-e,my_main -shared list.os -lc This code compiles and runs perfectly. My issue is when I change the parameter of the printf to be a float or double (%f or %lf). The library will then compile but segfault when run. Anyone have