diff --git a/asm2asm.py b/asm2asm.py index 5f1e8cb..b6571c1 100755 --- a/asm2asm.py +++ b/asm2asm.py @@ -1858,6 +1858,7 @@ def _alloc_instr(self, instr: Instruction): __instr_repl__ = { 'movdqa' : 'movdqu', 'movaps' : 'movups', + 'movapd' : 'movupd', 'vmovdqa' : 'vmovdqu', 'vmovaps' : 'vmovups', 'vmovapd' : 'vmovupd', @@ -2505,6 +2506,12 @@ def make_subr_filename(name: str) -> str: else: return '%s_subr_%s.go' % ('_'.join(base[:-1]), base[-1]) + +IGNORED_STUBS = { + "_do_xprintf", + "_write_syscall" +} + def main(): # check for arguments if len(sys.argv) < 3: @@ -2588,6 +2595,13 @@ def main(): print('import (\n\t`github.com/bytedance/sonic/loader`\n)', file = fp) print(file = fp) print('const (', file = fp) + + # remove duplicated symbols + keys = list(asm.code.funcs.keys()) + for name in keys: + if name in IGNORED_STUBS: + asm.code.funcs.pop(name) + for name in asm.code.funcs.keys(): addr = asm.code.get(name) if addr is not None: @@ -2626,7 +2640,7 @@ def main(): print('var _cfunc%s = []loader.CFunc{' % name, file = fp) print(' {"%s_entry", 0, _entry_%s, 0, nil},' % (name, name), file = fp) print(' {"%s", _entry_%s, _size_%s, _stack_%s, _pcsp_%s},' % (name, name, name, name, name), file = fp) - print('}', file = fp) + print('}', file = fp) else: print(file = fp)