mirror of
https://github.com/golang/go.git
synced 2024-09-22 10:58:58 +00:00
cmd/internal/objfile: recognize Mach-O __DATA_CONST segment as read-only data
Updates #38830. Change-Id: I826c6b0a42bc8e48fcda556250ca4a95c73987eb Reviewed-on: https://go-review.googlesource.com/c/go/+/253918 Run-TryBot: Cherry Zhang <cherryyz@google.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Than McIntosh <thanm@google.com>
This commit is contained in:
parent
9214677e7d
commit
a531bd5a59
@ -60,7 +60,7 @@ func (f *machoFile) symbols() ([]Sym, error) {
|
||||
} else if int(s.Sect) <= len(f.macho.Sections) {
|
||||
sect := f.macho.Sections[s.Sect-1]
|
||||
switch sect.Seg {
|
||||
case "__TEXT":
|
||||
case "__TEXT", "__DATA_CONST":
|
||||
sym.Code = 'R'
|
||||
case "__DATA":
|
||||
sym.Code = 'D'
|
||||
|
Loading…
Reference in New Issue
Block a user