-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path11.cpp
45 lines (39 loc) · 832 Bytes
/
11.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
#include <vector>
#include <iostream>
#include <fstream>
#include <stdio.h>
#include <stdlib.h>
#include <cmath>
#include <time.h>
#include <cstdint>
#include <cstring>
#include <dlfcn.h>
#include <x86intrin.h>
int main(){
char *error_str;
void *handle;
handle = dlopen ("./11.so", RTLD_LAZY);
if (!handle) {
fputs (dlerror(), stderr);
exit(1);
}
void (*mm)(long,long,long*);
mm =(void (*)(long,long,long*)) dlsym(handle, "add_sum");
if ((error_str = dlerror()) != NULL) {
fputs(error_str, stderr);
exit(1);
}
long*a;
a=(long *)malloc(1*sizeof(long));
printf("===========asm==========\n");
mm(257,5,a);
printf("===========result %ld==========\n",*a);
return 0;
}
/*
void sumstore(long x, long y,
long *dest) {
long t = x + y;
*dest = t;
}
*/