I'm trying to port a hacked program to GDB-7.6.1. The previous is fine under GDB-3.2.2. However, I meet some compile errors although I didn't touch anything related with these macro defined variables. Most important, the related sentences in the Makefile are the same. But the objdump shows they are different in the macro variables.
After configure, the compiler will complain
libsim.a(engine.o): In function `delayslot32':
/home/ruizhewu/work/gdb/gdb761-5-M3/gdb-7.6.1/lx-bcm-sc/sim/mips/../../../sim/mips/mips.igen:77: undefined reference to `SC_PRE_PROC_DELAY_SLOT'
/home/ruizhewu/work/gdb/gdb761-5-M3/gdb-7.6.1/lx-bcm-sc/sim/mips/../../../sim/mips/mips.igen:85: undefined reference to `SC_POST_PROC_DELAY_SLOT'
bash-3.2$ objdump -t libsim.a |less
........
support.o: file format elf64-x86-64
SYMBOL TABLE:
000000000000021d g F .text 00000000000000bd delayslot32
0000000000000000 *UND* 0000000000000000 SC_PRE_PROC_DELAY_SLOT
engine.o: file format elf64-x86-64
SYMBOL TABLE:
000000000000d72f l F .text 00000000000000bd delayslot32
...
...
...
0000000000000000 *UND* 0000000000000000 SC_PRE_PROC_DELAY_SLOT
The previous program, the engine.o ONLY has delayslot32, but NO SC_PRE_PROC_DELAY_SLOT
The mips.igen code is:
:function:::address_word:delayslot32:address_word target
{
instruction_word delay_insn;
SC_PRE_PROC_DELAY_SLOT(SD, CIA);
sim_events_slip (SD, 1);
DSPC = CIA;
CIA = CIA + 4; /* NOTE not mips16 */
STATE |= simDELAYSLOT;
delay_insn = IMEM32 (CIA); /* NOTE not mips16 */
idecode_issue (CPU_, delay_insn, (CIA));
STATE &= ~simDELAYSLOT;
SC_POST_PROC_DELAY_SLOT(SD);
return target;
}
The makefile is actually the same with the program under gdb3.2.2:
sim/mips/Makefile:
semantics.o: sim-main.h scSupport.h adslExtension.h semantics.c $(SIM_EXTRA_DEPS)
engine.o: sim-main.h scSupport.h adslExtension.h engine.c $(SIM_EXTRA_DEPS)
support.o: sim-main.h support.c $(SIM_EXTRA_DEPS)
idecode.o: sim-main.h scSupport.h adslExtension.h idecode.c $(SIM_EXTRA_DEPS)
itable.o: sim-main.h itable.c $(SIM_EXTRA_DEPS)
scSupport.o: scSupport.h adslExtension.h scSupport.c $(SIM_EXTRA_DEPS)
The undefined variable, which the compiler complain is actually defined in scSupport.h
#define SC_PRE_PROC_DELAY_SLOT(sd, cia) scEventEndOfInstExe(sd, cia)
#define SC_POST_PROC_DELAY_SLOT(sd)