add dlsym to actually check if my shit works
This commit is contained in:
parent
1abe051db0
commit
5d9e756153
2 changed files with 10 additions and 1 deletions
|
|
@ -25,7 +25,7 @@ $(OBJ_DIR)/%.o: %.s
|
|||
all: $(OBJ) $(DEPS)
|
||||
$(CC) $(LDFLAGS) -shared -o $(BIN_DIR)/relf_dummy.so obj/relf_dummy.o
|
||||
$(CC) $(LDFLAGS) -m32 -shared -o $(BIN_DIR)/relf_dummy32.so obj/relf_dummy.o32
|
||||
$(CC) $(LDFLAGS) -o $(BIN_DIR)/relf_test obj/relf_test.o $(LIB_DIR)/librelf.a
|
||||
$(CC) $(LDFLAGS) -o $(BIN_DIR)/relf_test obj/relf_test.o $(LIB_DIR)/librelf.a -ldl
|
||||
|
||||
debug: CFLAGS += -DDEBUG -g
|
||||
debug: LDFLAGS += -g
|
||||
|
|
|
|||
|
|
@ -1,4 +1,5 @@
|
|||
#include "relf/relf.h"
|
||||
#include <dlfcn.h>
|
||||
#include <stdio.h>
|
||||
|
||||
int main(int argc, char** argv)
|
||||
|
|
@ -8,5 +9,13 @@ int main(int argc, char** argv)
|
|||
|
||||
printf("image %p\n", dummy.image);
|
||||
printf("type %u\n", dummy.type);
|
||||
|
||||
relf_close(&dummy);
|
||||
|
||||
// dlopen
|
||||
void* so = dlopen(argv[1], RTLD_NOW);
|
||||
printf("dummy_function1 %p\n", dlsym(so, "dummy_function1"));
|
||||
dlclose(so);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue