0
다른 프로그램을 컴파일하여 exe 파일 (d.out)을 만들었습니다. nlist 함수는 항상 -1을 반환합니다. fopen func가 반환합니다! = null. 이 중요한 경우, 나는이 gcc -I/usr/include main.c -L/usr/lib/i386-linux-gnu/pkgconfig -lbsd
nlist 함수는 항상 -1을 반환합니다.
#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());
}
물론 존재합니다. 나는 그것을 열어 보았고 그것을 반환했다! = NULL. –
@ArseniyErmilov 그리고 물론 x 비트가 누락되지 않았습니까? 그리고'file d.out'은 그것이 실행 파일이라고 말합니까? – Jens
'd.out : ELF 32-bit LSB executable ...''-rwxrwxrwx 1 username ...' –