首页 > 试题广场 >

这道题是关于图7-5的m.o模块和下面的swap.c函数版

[问答题]
 这道题是关于图7-5的m.o模块和下面的swap.c函数版本的,该函数计算自己被调用的次数:

extern int buf[];

int *bufp0 = &buf [0];
static int *bufp1;

static void incr(){
    static int count=0;
    count++ ;
}
void swap(){
    int temp;
    incr();
    bufp1 = &buf[1];
    temp = *bufp0;
    *bufp0 = *bufp1;
    *bufp1 = temp;
}
对于每个swap.o中定义和引用的符号,请指出它是否在模块swap.o的.symtab节中有符号表条目。如果是这样,请指出定义该符号的模块(swap.o或m.o)、符号类型(局部、全局或外部)以及它在模块中所处的节(.text..data或.bss)。

这道题你会答吗?花几分钟告诉大家答案吧!