]> Cypherpunks repositories - gostls13.git/commit
[dev.link] cmd/link: refactor symbol to section assignment in allocateSections
authorThan McIntosh <thanm@google.com>
Fri, 17 Apr 2020 17:09:02 +0000 (13:09 -0400)
committerThan McIntosh <thanm@google.com>
Mon, 20 Apr 2020 19:26:32 +0000 (19:26 +0000)
commit5cccd7a7246099c3e1d268089ee6795933d7221f
treeb0aa3d8b8e7bbc1501a5fccbf01806ffb28b7405
parentc32b59026475342c9cf187b50e890a94c146bc79
[dev.link] cmd/link: refactor symbol to section assignment in allocateSections

Create a couple of helper routines to aid in assigning symbols to
sections in dodata's allocateSections, then replace loops over symbol
lists with calls to the helpers, to reduce the amount of duplicate
code.

This patch also decouples gcprog/gcdata generation from
symbol-to-section assignment (previously intertwined), as an aid to
making the code less complicated.

No change in functionality.

Change-Id: If126579486bce458f697e32bad556df453df53e9
Reviewed-on: https://go-review.googlesource.com/c/go/+/228781
Reviewed-by: Jeremy Faller <jeremy@golang.org>
Reviewed-by: Cherry Zhang <cherryyz@google.com>
src/cmd/link/internal/ld/data.go