Skip to content

Commit

Permalink
sys/targets: use a different SYZ_DATA_OFFSET for 32-bit FreeBSD (goog…
Browse files Browse the repository at this point in the history
…le#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
  • Loading branch information
tuexen authored Jun 11, 2020
1 parent 3ab7a05 commit dfdd11f
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions sys/targets/targets.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"},
Expand Down Expand Up @@ -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 == "" {
Expand Down

0 comments on commit dfdd11f

Please sign in to comment.