aboutsummaryrefslogtreecommitdiffstats
path: root/sys
diff options
context:
space:
mode:
authorMichael Tüxen <tuexen@fh-muenster.de>2020-06-11 17:57:14 +0200
committerGitHub <noreply@github.com>2020-06-11 17:57:14 +0200
commitdfdd11f7777557e4540f3319ff8b5f8ddf82bf19 (patch)
tree274c677c6c2ab5e0c39af6968af5e3c75a8dd80f /sys
parent3ab7a05ad80cc06be6bbf3744e5272795a078fbf (diff)
sys/targets: use a different SYZ_DATA_OFFSET for 32-bit FreeBSD (#1809)
* sys/targets: use a different SYZ_DATA_OFFSET for 32-bit FreeBSD It seems that the value used on all platforms (512 << 20) does not work on 32-bit FreeBSD when using the clang tools. Try (256 << 20) instead. * sys/targets: add comment why a non-default value is needed
Diffstat (limited to 'sys')
-rw-r--r--sys/targets/targets.go13
1 files changed, 9 insertions, 4 deletions
diff --git a/sys/targets/targets.go b/sys/targets/targets.go
index f36257773..bd1f5fc26 100644
--- a/sys/targets/targets.go
+++ b/sys/targets/targets.go
@@ -203,9 +203,12 @@ var List = map[string]map[string]*Target{
NeedSyscallDefine: dontNeedSyscallDefine,
},
"386": {
- VMArch: "amd64",
- PtrSize: 4,
- PageSize: 4 << 10,
+ VMArch: "amd64",
+ PtrSize: 4,
+ PageSize: 4 << 10,
+ // The default DataOffset doesn't work with 32-bit
+ // FreeBSD and using ld.lld due to collisions.
+ DataOffset: 256 << 20,
Int64Alignment: 4,
CCompiler: "clang",
CFlags: []string{"-m32"},
@@ -447,7 +450,9 @@ func initTarget(target *Target, OS, arch string) {
if target.NeedSyscallDefine == nil {
target.NeedSyscallDefine = needSyscallDefine
}
- target.DataOffset = 512 << 20
+ if target.DataOffset == 0 {
+ target.DataOffset = 512 << 20
+ }
target.NumPages = (16 << 20) / target.PageSize
sourceDir := os.Getenv("SOURCEDIR_" + strings.ToUpper(OS))
if sourceDir == "" {