日期:2014-05-16 浏览次数:20843 次
#include <stdlib.h>
#include <string.h>
#include <inttypes.h>
#include <stdio.h>
void bug2(void *a,void *b,uint64_t offset,uint64_t size,void *fp,int ver)
{
printf("fp:%p\n",fp);
}
#include <stdlib.h>
#include <string.h>
#include <inttypes.h>
#include <stdio.h>
void bug1(void *a,void *b,uint64_t offset,uint64_t size,void *fp,int ver)
{
printf("fp:%p\n",fp);
}
int main()
{
void *a = malloc(1);
void *b = malloc(1);
void *fp = malloc(1);
off_t offset = 1;
size_t size = 1;
bug1(a,b,offset,size,fp,1);
bug2(a,b,offset,size,fp,1);
free(a);
free(b);
free(fp);
return 0;
}
all:bug bug.asm
bug.asm:bug
objdump -SD bug >bug.asm
bug:bug.o bug_ex.o
gcc -g -o bug bug.o bug_ex.o
bug.o:bug.c
gcc -g -D_FILE_OFFSET_BITS=64 -c bug.c
bug_ex.o:bug_ex.c
gcc -g -D_FILE_OFFSET_BITS=64 -c bug_ex.c
clean:
rm -f bug.o bug_ex.o bug bug.asm