Skip to content

Commit

Permalink
baremetal: define the abort function
Browse files Browse the repository at this point in the history
This is normally provided by the libc, but in our case it makes more
sense to define it in the runtime (just like malloc).
  • Loading branch information
aykevl committed Sep 24, 2021
1 parent 2f85ef1 commit 0fe8147
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/runtime/baremetal.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,11 @@ func libc_free(ptr unsafe.Pointer) {
free(ptr)
}

//export abort
func libc_abort() {
abort()
}

//go:linkname syscall_Exit syscall.Exit
func syscall_Exit(code int) {
abort()
Expand Down

0 comments on commit 0fe8147

Please sign in to comment.