Need help in solving error generated while building compiler (stage-2)

Priyanka Dudani dudani.priyanka@gmail.com
Mon Jun 7 17:23:00 GMT 2010


Hello

I need to encrypt return address when calling a function by modifying
prologue and epilogue of the compiler. I am trying to do the same by
XORing return address with EBP register value.
Here is the code i have written in ix86_expand_prologue() method in i386.c file.

if (frame_pointer_needed)
    {
      insn = emit_insn (gen_push (hard_frame_pointer_rtx));
      RTX_FRAME_RELATED_P (insn) = 1;
      insn = emit_move_insn (hard_frame_pointer_rtx, stack_pointer_rtx);
      RTX_FRAME_RELATED_P (insn) = 1;

                ebp_plus = gen_rtx_REG(Pmode, CX_REG);
                ebp = gen_rtx_REG(Pmode, BP_REG);
                emit_move_insn(ebp_plus,
plus_constant(hard_frame_pointer_rtx, 4));
                if (TARGET_64BIT)
                insn = emit_insn(gen_xordi3(ebp_plus, ebp_plus,
hard_frame_pointer_rtx));
                else
                 insn = emit_insn(gen_xorsi3(ebp_plus, ebp_plus,
hard_frame_pointer_rtx));
    }

Similar code in ix86_expand_epilogue() method.

While building the compiler, it gets built till stage-1 successfully.
But gives the following error at the end of stage-2

../../gcc-4.3.3/gcc/config/i386/i386.md:16349 : error :
'TARGET_USE_CCGOCMODE_FIOP' undeclared here (not in a function)

The line 16349 in i386.md file, at which error occurs has the
following code written

16349  "TARGET_80387 && TARGET_USE_<MODE>MODE_FIOP"
16350  "* return which_alternative ? \"#\" : output_387_binary_op
(insn, operands);"

The error is related to the mode of the compiler but i am not able to
figure out what is causing this error.

Please tell me what can be the cause of the error or where am i going wrong ?
Please help me with this.

Thanking You,
Priyanka Dudani
B.Tech(ICT)
DA-IICT



More information about the Gcc-help mailing list