Skip to content

Commit

Permalink
fix bug misaligned func
Browse files Browse the repository at this point in the history
  • Loading branch information
pkujhd committed Jul 27, 2024
1 parent b3420f1 commit 45232d7
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions ld.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand All @@ -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
}
Expand Down

0 comments on commit 45232d7

Please sign in to comment.