go/src/cmd/link
Cherry Zhang be1da9cdee 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>
2021-05-03 16:20:10 +00:00
..
internal cmd/link: unify text segment write 2021-05-03 16:20:10 +00:00
testdata cmd/link: recognize ARM64 PE files and relocations 2021-02-26 18:15:09 +00:00
doc.go cmd/link: move comma outside quotes 2020-08-15 08:24:23 +00:00
dwarf_test.go cmd/link: use testing.T.TempDir in tests 2021-03-08 20:03:01 +00:00
elf_test.go cmd/link: use testing.T.TempDir in tests 2021-03-08 20:03:01 +00:00
link_test.go cmd/link: test trampolines with cgo 2021-04-29 16:29:52 +00:00
linkbig_test.go internal/buildcfg: move build configuration out of cmd/internal/objabi 2021-04-16 19:20:53 +00:00
main.go internal/buildcfg: move build configuration out of cmd/internal/objabi 2021-04-16 19:20:53 +00:00