aboutsummaryrefslogtreecommitdiffstats
path: root/pkg
diff options
context:
space:
mode:
authorAlexander Egorenkov <Alexander.Egorenkov@ibm.com>2020-06-26 11:12:00 +0200
committerDmitry Vyukov <dvyukov@google.com>2020-06-26 12:01:33 +0200
commitb202c7a8a2a033a10f17bb2fa0f790851075ae2b (patch)
treee3dc13731cef9704e9bc5c6b00ce7cfe28070123 /pkg
parentaea82c003a1826ebd9bf53194bb40fe911f9c23e (diff)
pkg/csource: fix casting of parameters for trampolines
Signed-off-by: Alexander Egorenkov <Alexander.Egorenkov@ibm.com>
Diffstat (limited to 'pkg')
-rw-r--r--pkg/csource/csource.go7
-rw-r--r--pkg/csource/generated.go5
2 files changed, 9 insertions, 3 deletions
diff --git a/pkg/csource/csource.go b/pkg/csource/csource.go
index 8818e4f1c..2799920e3 100644
--- a/pkg/csource/csource.go
+++ b/pkg/csource/csource.go
@@ -265,13 +265,14 @@ func (ctx *context) emitCall(w *bytes.Buffer, call prog.ExecCall, ci int, haveCo
}
func (ctx *context) emitCallName(w *bytes.Buffer, call prog.ExecCall, native bool) {
- callName := call.Meta.CallName
+ callName, ok := ctx.sysTarget.SyscallTrampolines[call.Meta.CallName]
+ if !ok {
+ callName = call.Meta.CallName
+ }
if native {
fmt.Fprintf(w, "syscall(%v%v", ctx.sysTarget.SyscallPrefix, callName)
} else if strings.HasPrefix(callName, "syz_") {
fmt.Fprintf(w, "%v(", callName)
- } else if trampolineName, ok := ctx.sysTarget.SyscallTrampolines[callName]; ok {
- fmt.Fprintf(w, "%v(", trampolineName)
} else {
args := strings.Repeat(",intptr_t", len(call.Args))
if args != "" {
diff --git a/pkg/csource/generated.go b/pkg/csource/generated.go
index e374b593f..b84dfec91 100644
--- a/pkg/csource/generated.go
+++ b/pkg/csource/generated.go
@@ -8376,6 +8376,11 @@ static void setup_usb()
}
#endif
+#if GOARCH_s390x
+#include <sys/mman.h>
+#define CAST(f) ({void* p = (void*)f; p; })
+#endif
+
#elif GOOS_test
#include <stdlib.h>