From 45232d7263860cba63b50c0a7425af13e4424a99 Mon Sep 17 00:00:00 2001 From: pkujhd Date: Sat, 27 Jul 2024 18:10:11 +0800 Subject: [PATCH] fix bug misaligned func --- ld.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/ld.go b/ld.go index e62fcd4..9077047 100644 --- a/ld.go +++ b/ld.go @@ -416,6 +416,7 @@ func (linker *Linker) addFuncTab(module *moduledata, _func *_func, symbolMap map return err } + grow(&module.pclntable, PtrSize) append2Slice(&module.pclntable, uintptr(unsafe.Pointer(_func)), _FuncSize) if _func.Npcdata > 0 { @@ -425,6 +426,7 @@ func (linker *Linker) addFuncTab(module *moduledata, _func *_func, symbolMap map if _func.Nfuncdata > 0 { addfuncdata(module, Func, _func) } + grow(&module.pclntable, PtrSize) return err }