Skip to content

Commit 9a073d0

Browse files
authored
rename _noop_free -> _noop_free_v2 (#48)
Go ASM symbols are not bound by the major versioning ABI breakage go imposes, therefore we must change the name of the symbol manually for the v1 and the v2 version to coexist in the same binary. Example error: ``` link: duplicated definition of symbol _noop_free, from github.com/DataDog/go-libddwaf/internal/noopfree and github.com/DataDog/go-libddwaf/v2/internal/noopfree ```
1 parent d9cca27 commit 9a073d0

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

internal/noopfree/noopfree.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,6 @@ package noopfree
1010

1111
import "unsafe"
1212

13-
//go:linkname _noop_free _noop_free
14-
var _noop_free byte
15-
var NoopFreeFn uintptr = uintptr(unsafe.Pointer(&_noop_free))
13+
//go:linkname _noop_free_v2 _noop_free_v2
14+
var _noop_free_v2 byte
15+
var NoopFreeFn uintptr = uintptr(unsafe.Pointer(&_noop_free_v2))

internal/noopfree/noopfree.s

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,6 @@
55

66
#include "textflag.h"
77

8-
TEXT _noop_free(SB), NOSPLIT, $0-0
8+
TEXT _noop_free_v2(SB), NOSPLIT, $0-0
99
RET
1010

0 commit comments

Comments
 (0)