I made exe file (d.out) by compiling another program. And nlist function always returns -1. fopen func returns !=null. If it matters i compile my prog like this
gcc -I/usr/include main.c -L/usr/lib/i386-linux-gnu/pkgconfig -lbsd
#include <string.h>
#include <bsd/nlist.h>
#include <stdio.h>
#include <stdlib.h>
int test(){
struct nlist nl[2];
memset(&nl, 0, sizeof(nl));
return nlist("d.out", nl);
// return nl[0].n_value;
}
int main(){
printf("%d \n", test());
}