[dev.link] cmd/link: refactor section creation in dodata
[dev.link] cmd/link: refactor section creation in dodata

Additional cleanups and refactorings in the allocateSections portion
of dodata. Introduce some new helper routines to be used for common
cases in creating sections and assigning symbols, with a goal of
reducing duplicated code blocks and having more readable code.

No change in functionality.

Change-Id: I1b020b3ee993674329b2bebfd7c35995e3a2c043
Reviewed-on: https://go-review.googlesource.com/c/go/+/228883
Reviewed-by: Cherry Zhang <d62e63aa42ce272d7b6a5055d97e942b33a34679@google.com>
Reviewed-by: Jeremy Faller <b3f594e10a9edcf5413cf1190121d45078c62290@golang.org>

cloudflare/go,CAFxX/go,nawawi/go,nawawi/go,golang/go,nawawi/go,CAFxX/go,golang/go,golang/go,nawawi/go,akutz/go,akutz/go,cloudflare/go,cloudflare/go,nawawi/go,golang/go,CAFxX/go,cloudflare/go,akutz/go,CAFxX/go,cloudflare/go,cloudflare/go,golang/go,akutz/go,akutz/go,golang/go,golang/go,CAFxX/go,akutz/go,nawawi/go,CAFxX/go,cloudflare/go,nawawi/go,akutz/go,nawawi/go,akutz/go,cloudflare/go,CAFxX/go,golang/go,CAFxX/go