-
Notifications
You must be signed in to change notification settings - Fork 18k
cmd/link: make code more readable #16818
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
CL https://golang.org/cl/27459 mentions this issue. |
This change threads the *ld.Link Ctxt variable through code in arch-specific packages. This removes all remaining uses of Ctxt, so remove the global variable too. This CL continues the work in golang.org/cl/27408 Updates #16818 Change-Id: I5f4536847a1825fd0b944824e8ae4e122ec0fb78 Reviewed-on: https://go-review.googlesource.com/27459 Run-TryBot: Michael Matloob <[email protected]> Reviewed-by: Brad Fitzpatrick <[email protected]> TryBot-Result: Gobot Gobot <[email protected]>
Bso is already a member on ld.Link. Use that instead of the global. Updates #16818 Change-Id: Icfc0f6cb1ff551e8129253fb6b5e0d6a94479f51 Reviewed-on: https://go-review.googlesource.com/27470 Run-TryBot: Michael Matloob <[email protected]> Reviewed-by: Brad Fitzpatrick <[email protected]> TryBot-Result: Gobot Gobot <[email protected]>
CL https://golang.org/cl/27472 mentions this issue. |
CL https://golang.org/cl/27471 mentions this issue. |
The obj library's flag functions are (mostly) light wrappers around the standard library flag package. Use the flag package directly where possible. Most uses of the 'count'-type flags (except for -v) only check against 0, so they can safely be replaced by bools. Only -v and the flagfns haven't been replaced. Debug has been turned into a slice of bools rather than ints. There was a copy of the -v verbosity in ctxt.Debugvlog, so don't use Debug['v'] and just use ctxt.Debugvlog. Updates #16818 Change-Id: Icf6473a4823c9d35513bbd0c34ea02d5676d782a Reviewed-on: https://go-review.googlesource.com/27471 Run-TryBot: Michael Matloob <[email protected]> TryBot-Result: Gobot Gobot <[email protected]> Reviewed-by: Brad Fitzpatrick <[email protected]>
The only thing pobj contains is the Ldmain function. Updates #16818 Change-Id: Id114bdb264cb5ea2f372eb2166201f1f8eb99445 Reviewed-on: https://go-review.googlesource.com/27472 Run-TryBot: Michael Matloob <[email protected]> TryBot-Result: Gobot Gobot <[email protected]> Reviewed-by: Brad Fitzpatrick <[email protected]>
CL https://golang.org/cl/27473 mentions this issue. |
This moves many of the flag globals into main and assigns them to their flag.String/Int64/... directly. Updates #16818 Change-Id: Ibbff44a273bbc5cb7228e43f147900ee8848517f Reviewed-on: https://go-review.googlesource.com/27473 Reviewed-by: David Crawshaw <[email protected]>
CL https://golang.org/cl/27468 mentions this issue. |
I've also unexported a few symbols that weren't used outside the package. Updates #16818 Change-Id: I39d9d87b3eec30b88b4a17c1333cfbbfa6b3518f Reviewed-on: https://go-review.googlesource.com/27468 Run-TryBot: Michael Matloob <[email protected]> TryBot-Result: Gobot Gobot <[email protected]> Reviewed-by: David Crawshaw <[email protected]>
@matloob - Can you post an update here on what are the things pending on this so that others can pick this up if they want to ? |
This is totally obsolete, closing. |
I'd like to clean up cmd/link and help improve its Go style.
A few things I'd like to do:
The text was updated successfully, but these errors were encountered: