Perhaps you could strip the dynamic information from the executable before comparing it?

/Pepijn