Menu

Function comparison

Anonymous
2007-07-14
2013-04-18
  • Anonymous

    Anonymous - 2007-07-14

    It is needed to find a trick to compare two function to be same.
    Same - means same assembly instructions.

    There is no way to do it because compiler can make partial functions and so on.

    Probable solution:
    There are no RET instructions in the middle of the function, there are no JMP instructions.
    Then function can be compared binary as is.

     
    • remark

      remark - 2007-07-16

      >It is needed to find a trick to compare two function to be same.

      Why we need this? How this can help?

       
      • Anonymous

        Anonymous - 2007-07-28

        It is needed to prove that functions are binary equal.
        For example VC linker can optimize equal functions to one function, so the check may be just compare the address.
        GCC can do it too with -ffunction-sections but some other compilers may not do it.

        (I do not write in russian to help some non russian people to understand the conversation :) )

         
    • Yuval Kohavi

      Yuval Kohavi - 2007-07-28

      I think that you should compare things the the function code affect, not the code itself. you should check Binary File size, and program speed. That will give you a good estimate.

       
      • Anonymous

        Anonymous - 2007-07-28

        Too much huristics.
        IMHO I should check GCC flag for compacting functions.
        If it works, I can rely on the same address for most cases.

         

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.