]> Cypherpunks repositories - gostls13.git/commit
cmd/link: unify text segment write
authorCherry Zhang <cherryyz@google.com>
Sat, 1 May 2021 19:00:03 +0000 (15:00 -0400)
committerCherry Zhang <cherryyz@google.com>
Mon, 3 May 2021 16:20:10 +0000 (16:20 +0000)
commitbe1da9cdeecba15d0f68b4dcc145bcc77c0c4ace
tree8f1bee6fcc87fa8d3c95eab951217435c04d3986
parent8327d2150f97528dc6a3090ddee99db0e9872212
cmd/link: unify text segment write

Currently we have two code paths of writing the text segment. They
are semantically the same:

- if we split text sections, we write all ".text" sections as
  text and the the rest as data.
- if we do not split text sections, we write the first section
  as text and the rest as data. The first section is named ".text"
  and is the only one in this case.

Unify the code.

Change-Id: Ic639eed625615be3c8a8d41f5b47e901552f587a
Reviewed-on: https://go-review.googlesource.com/c/go/+/316049
Trust: Cherry Zhang <cherryyz@google.com>
Reviewed-by: Than McIntosh <thanm@google.com>
src/cmd/link/internal/ld/asmb.go
src/cmd/link/internal/ld/lib.go
src/cmd/link/internal/ppc64/obj.go