fix bugs, still some bugs left in reloc calculating