aboutsummaryrefslogtreecommitdiff
path: root/src/cmd/link/internal/mips64
AgeCommit message (Collapse)Author
2026-03-27all: remove openbsd/mips64 portTobias Klauser
The openbsd/mips64 port is dead, remove the remaining code specific to that port and clean up build tags. Fixes #61546 Change-Id: I0328b7b76ce1ddacd3a526b3f4ae29eaa1254c3f Reviewed-on: https://go-review.googlesource.com/c/go/+/746480 Reviewed-by: Dmitri Shuralyov <dmitshur@google.com> Auto-Submit: Tobias Klauser <tobias.klauser@gmail.com> Reviewed-by: Joel Sing <joel@sing.id.au> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: Carlos Amedee <carlos@golang.org>
2025-10-21all: eliminate unnecessary type conversionsJes Cok
Found by github.com/mdempsky/unconvert Change-Id: I88ce10390a49ba768a4deaa0df9057c93c1164de GitHub-Last-Rev: 3b0f7e8f74f58340637f33287c238765856b2483 GitHub-Pull-Request: golang/go#75974 Reviewed-on: https://go-review.googlesource.com/c/go/+/712940 LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: Keith Randall <khr@golang.org> Auto-Submit: Keith Randall <khr@golang.org> Reviewed-by: Keith Randall <khr@google.com> Reviewed-by: David Chase <drchase@google.com>
2023-09-13cmd/link: round up default start address to alignmentCherry Mui
If the -R flag (the segment alignment) is specified but the -T flag (start address) is not, currently the default start address may be under-aligned, and some math in the linker may be broken. Round up the start address to align it. Fixes #62064. Change-Id: I3b98c9d0cf7d3cd944b9436a36808899d2e52572 Reviewed-on: https://go-review.googlesource.com/c/go/+/527822 Run-TryBot: Cherry Mui <cherryyz@google.com> Reviewed-by: Than McIntosh <thanm@google.com> TryBot-Result: Gopher Robot <gobot@golang.org>
2023-08-23cmd/internal/obj/riscv,cmd/link: add support for internal cgo linking on riscv64Joel Sing
Make it possible to internally link cgo on riscv64, which also adds support for SDYNIMPORT calls without external linking being required. This reduces the time of an ./all.bash run on a Sifive Hifive Unleashed by approximately 20% (~140 minutes down to ~110 minutes). Change-Id: I43f1348de31672718ae8676cc82f6fdc1dfee054 Reviewed-on: https://go-review.googlesource.com/c/go/+/431104 TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Cherry Mui <cherryyz@google.com> Run-TryBot: Joel Sing <joel@sing.id.au> Reviewed-by: Than McIntosh <thanm@google.com>
2023-02-22cmd/link: add internal linking support for calling SDYNIMPORT on mips64Joel Sing
Add internal linking support for calling SDYNIMPORT symbols on mips64. This adds code to generate appropriate PLT and GOT entries, along with the various dynamic entries needed for the dynamic loader. Updates #36435, #46178 Change-Id: I783e0d028510ca2bca82bcbc745f2375770813fe Reviewed-on: https://go-review.googlesource.com/c/go/+/415815 Reviewed-by: Rong Zhang <rongrong@oss.cipunited.com> Run-TryBot: Ian Lance Taylor <iant@google.com> Run-TryBot: Joel Sing <joel@sing.id.au> Reviewed-by: Ian Lance Taylor <iant@google.com> Reviewed-by: Than McIntosh <thanm@google.com> TryBot-Result: Gopher Robot <gobot@golang.org> Auto-Submit: Ian Lance Taylor <iant@google.com>
2023-02-10cmd/link: improve error for missing SDYNIMPORT support on mips/mips64Than McIntosh
Issue an error (instead of crashing) when encountering a symbol that requires dynamic relocations on mips/mips64. The dynimport support is in progress, but is not done yet, so rather than crashing, print a message indicating that the feature is not yet implemented and exit. Fixes #58240. Change-Id: I9ad64c89e4f7b4b180964b35ad1d72d375f2df7f Reviewed-on: https://go-review.googlesource.com/c/go/+/466895 TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Joel Sing <joel@sing.id.au> Reviewed-by: David Chase <drchase@google.com> Run-TryBot: Than McIntosh <thanm@google.com>
2023-01-31cmd/link: rename ELF struct fields to remove "elf" prefixIan Lance Taylor
While we're here rename setupplt to setupPLT. This is a pure naming change with no semantic change. Change-Id: Ib0312fb6568475b620dab7632438b4d25e4d9cc0 Reviewed-on: https://go-review.googlesource.com/c/go/+/463744 Reviewed-by: Than McIntosh <thanm@google.com> Reviewed-by: Cherry Mui <cherryyz@google.com> TryBot-Result: Gopher Robot <gobot@golang.org> Run-TryBot: Ian Lance Taylor <iant@golang.org> Auto-Submit: Ian Lance Taylor <iant@golang.org>
2023-01-31cmd/link: make .dynamic section read-only for MIPS ELFIan Lance Taylor
For #36435 Change-Id: Ie733b641f20ca5bcee3784c088eb27699890a151 Reviewed-on: https://go-review.googlesource.com/c/go/+/463982 Reviewed-by: Joel Sing <joel@sing.id.au> Reviewed-by: Cherry Mui <cherryyz@google.com> Auto-Submit: Ian Lance Taylor <iant@golang.org> TryBot-Result: Gopher Robot <gobot@golang.org> Run-TryBot: Ian Lance Taylor <iant@golang.org> Reviewed-by: Than McIntosh <thanm@google.com>
2023-01-30cmd/link: refactor ELF hooks into ELFArch structIan Lance Taylor
This is a pure cleanup to bring the ELF hooks together. Change-Id: I01d5227c70f30e4a659dcd7904e7c247266e95b1 Reviewed-on: https://go-review.googlesource.com/c/go/+/463981 Auto-Submit: Ian Lance Taylor <iant@golang.org> Reviewed-by: Than McIntosh <thanm@google.com> Reviewed-by: Cherry Mui <cherryyz@google.com> Run-TryBot: Ian Lance Taylor <iant@golang.org> TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Joel Sing <joel@sing.id.au>
2022-08-08cmd/link: detect glibc vs musl ldso at link timeRuss Cox
Doing the test at link time lets us distribute one Linux toolchain that works on both glibc-based and musl-based Linux systems. The old way built a toolchain that only ran on one or the other. Fixes #54197. Change-Id: Iaae8c274c78e1091eee828a720b49646be9bfffe Reviewed-on: https://go-review.googlesource.com/c/go/+/420774 Auto-Submit: Russ Cox <rsc@golang.org> Reviewed-by: Cherry Mui <cherryyz@google.com> TryBot-Result: Gopher Robot <gobot@golang.org> Run-TryBot: Russ Cox <rsc@golang.org>
2021-09-22cmd/link: remove ABI aliasesCherry Mui
It is now gone. Change-Id: I59f68b324af706476695de2f291dd3aa5734e192 Reviewed-on: https://go-review.googlesource.com/c/go/+/351332 Trust: Cherry Mui <cherryyz@google.com> Run-TryBot: Cherry Mui <cherryyz@google.com> TryBot-Result: Go Bot <gobot@golang.org> Reviewed-by: Than McIntosh <thanm@google.com>
2021-04-28cmd/dist,runtime: support cgo on openbsd/mips64Joel Sing
Add support for cgo on openbsd/mips64. Fixes #43005 Change-Id: I2386204f53fa984a01a9d89f0b6c96455768f326 Reviewed-on: https://go-review.googlesource.com/c/go/+/275896 Trust: Joel Sing <joel@sing.id.au> Run-TryBot: Joel Sing <joel@sing.id.au> Reviewed-by: Cherry Zhang <cherryyz@google.com>
2021-04-16internal/buildcfg: move build configuration out of cmd/internal/objabiRuss Cox
The go/build package needs access to this configuration, so move it into a new package available to the standard library. Change-Id: I868a94148b52350c76116451f4ad9191246adcff Reviewed-on: https://go-review.googlesource.com/c/go/+/310731 Trust: Russ Cox <rsc@golang.org> Run-TryBot: Russ Cox <rsc@golang.org> Reviewed-by: Austin Clements <austin@google.com> Reviewed-by: Jay Conrod <jayconrod@google.com>
2021-03-18cmd/link: Add section data slice to ArchrelocvariantPaul E. Murphy
PPC64 needs to preserve bits when applying some relocations. DS form relocations must preserve the lower two bits, and thus needs to inspect the section data as it streams out. Similarly, the overflow checking requires inspecting the primary opcode to see if the value is sign or zero extended. The existing PPC64 code no longer works as the slice returned by (loader*).Data is cleared as we layout the symbol and process relocations. This data is always the section undergoing relocation, thus we can directly inspect the contents to preserve bits or check for overflows. Change-Id: I239211f7e5e96208673663b6553b3017adae7e01 Reviewed-on: https://go-review.googlesource.com/c/go/+/300555 Run-TryBot: Paul Murphy <murp@ibm.com> Reviewed-by: Cherry Zhang <cherryyz@google.com> TryBot-Result: Go Bot <gobot@golang.org> Trust: Emmanuel Odeke <emmanuel@orijtech.com>
2020-10-03cmd/link: add support for openbsd/mips64Joel Sing
Update #40995 Change-Id: I2cf9b85a960f479eaa59bf58081d03a0467bc2b8 Reviewed-on: https://go-review.googlesource.com/c/go/+/250582 Trust: Joel Sing <joel@sing.id.au> Run-TryBot: Joel Sing <joel@sing.id.au> Reviewed-by: Matthew Dempsky <mdempsky@google.com> TryBot-Result: Go Bot <gobot@golang.org>
2020-07-30[dev.link] cmd/link: remove "2", another roundCherry Zhang
Rename Reloc2 to Reloc, At2 to At, Aux2 to Aux. Change-Id: Ic98d83c080e8cd80fbe1837c8f0aa134033508ce Reviewed-on: https://go-review.googlesource.com/c/go/+/245578 Reviewed-by: Jeremy Faller <jeremy@golang.org>
2020-07-30[dev.link] cmd/link: refactor ExtReloc data structuresCherry Zhang
We used to generate all external relocations in memory, then emit the relocation records at a later pass. The data structures were chosen so that it takes as little memory as possible. Now we just stream out external relocations, and ExtReloc is just a local variable. Change the data structure to avoid repeated read of some fields. Also get rid of ExtRelocView, as it is no longer necessary. Change-Id: I40209bbe4387af231b29788125c3b4ebb0ff4a33 Reviewed-on: https://go-review.googlesource.com/c/go/+/245479 Run-TryBot: Cherry Zhang <cherryyz@google.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Jeremy Faller <jeremy@golang.org>
2020-07-30[dev.link] cmd/link: move arch-specific extreloc to common codeCherry Zhang
Change-Id: Ia833818862b277ac83266919f39e5c25faac895e Reviewed-on: https://go-review.googlesource.com/c/go/+/245478 Run-TryBot: Cherry Zhang <cherryyz@google.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Jeremy Faller <jeremy@golang.org>
2020-07-24[dev.link] cmd/link: remove non-streaming external relocation codeCherry Zhang
Now we support streaming external relocations everywhere. Change-Id: I8d107c8239fe979bd5410e6a7f3fe471ac3e8b35 Reviewed-on: https://go-review.googlesource.com/c/go/+/244764 Run-TryBot: Cherry Zhang <cherryyz@google.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Jeremy Faller <jeremy@golang.org>
2020-07-23[dev.link] cmd/link: stream external relocations on MIPS (32/64)Cherry Zhang
Change-Id: I47fbeb3a49754395dceff51af371638fd43350ff Reviewed-on: https://go-review.googlesource.com/c/go/+/244097 Run-TryBot: Cherry Zhang <cherryyz@google.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Jeremy Faller <jeremy@golang.org>
2020-07-21[dev.link] cmd/link: remove OutDataCherry Zhang
OutData was used for a symbol to point to its data in the output buffer, in order to apply relocations. Now we fold relocation application to Asmb next to symbol data writing. We can just pass the output data as a local variable. Linking cmd/compile, name old time/op new time/op delta Asmb_GC 19.0ms ±10% 16.6ms ± 9% -12.50% (p=0.032 n=5+5) name old alloc/op new alloc/op delta Asmb_GC 3.78MB ± 0% 0.14MB ± 1% -96.41% (p=0.008 n=5+5) name old live-B new live-B delta Asmb_GC 27.5M ± 0% 23.9M ± 0% -13.24% (p=0.008 n=5+5) Change-Id: Id870a10dce2a0a7447a05029c6d0ab39b47d0a12 Reviewed-on: https://go-review.googlesource.com/c/go/+/244017 Reviewed-by: Jeremy Faller <jeremy@golang.org>
2020-07-06[dev.link] cmd/link: write ELF relocations in mmap on all architecturesCherry Zhang
In CL 240399 we changed to precompute the size for ELF relocation records and use mmap to write them, but we left architectures where elfreloc1 write non-fixed number of bytes. This CL handles those architectures. When a Go relocation will turn into multiple ELF relocations, in relocsym we account this difference and add it to the size calculation. So when emitting ELF relocations, we know the number of ELF relocations to be emitted. Change-Id: I6732ab674b442f4618405e5412a77f6e4a3315d7 Reviewed-on: https://go-review.googlesource.com/c/go/+/241079 Reviewed-by: Than McIntosh <thanm@google.com> Reviewed-by: Jeremy Faller <jeremy@golang.org>
2020-07-05[dev.link] cmd/link: parallelize ELF relocation writingCherry Zhang
Now that we write ELF relocation records in mapped memory with known sizes and offsets, we can write them in parallel. Further speed up Asmb2 pass. Linking cmd/compile with external linking, Asmb2 141ms ± 4% 97ms ± 5% -30.98% (p=0.000 n=10+9) Change-Id: I52c2b9230e90ed4421c21d7ef13a4f1e996f6054 Reviewed-on: https://go-review.googlesource.com/c/go/+/240400 Run-TryBot: Cherry Zhang <cherryyz@google.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Than McIntosh <thanm@google.com>
2020-07-05[dev.link] cmd/link: emit ELF relocations in mmapCherry Zhang
Currently, ELF relocations are generated sequentially in the heap and flushed to output file periodically. In fact, in some cases, the output size of the relocation records can be easily computed, as a relocation entry has fixed size. We only need to count the number of relocation records to compute the size. Once the size is computed, we can mmap the output with the proper size, and directly write relocation records in the mapped memory. It also opens the possibility of writing relocations in parallel (not done in this CL). Note: on some architectures, a Go relocation may turn into multiple ELF relocations, which makes size calculation harder. This CL does not handle those cases, and it still writes sequentially in the heap there. Linking cmd/compile with external linking, name old time/op new time/op delta Asmb2 190ms ± 2% 141ms ± 4% -25.74% (p=0.000 n=10+10) name old alloc/op new alloc/op delta Asmb2_GC 66.8MB ± 0% 8.2MB ± 0% -87.79% (p=0.008 n=5+5) name old live-B new live-B delta Asmb2_GC 66.9M ± 0% 55.2M ± 0% -17.58% (p=0.008 n=5+5) Change-Id: If7056bbe909dc90033eef6b9c4891fcca310602c Reviewed-on: https://go-review.googlesource.com/c/go/+/240399 Run-TryBot: Cherry Zhang <cherryyz@google.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Than McIntosh <thanm@google.com>
2020-06-05[dev.link] all: merge branch 'master' into dev.linkCherry Zhang
Merge conflicts are mostly recently changed nm/objdump output format and its tests. Resolved easily (mostly just using the format on master branch). Change-Id: I99d8410a9a02947ecf027d9cae5762861562baf5
2020-06-04all: fix dead links to inferno-os bitbucket repositoryTobias Klauser
Generated using: perl -i -npe 's#inferno-os/src/default#inferno-os/src/master#' $(git grep -l "inferno-os/src/default" | grep -v vendor) Change-Id: I4b6443bd09a8ea4c8aaeb40a1c73520d1f7ca648 Reviewed-on: https://go-review.googlesource.com/c/go/+/235821 Reviewed-by: Cherry Zhang <cherryyz@google.com> Reviewed-by: Austin Clements <austin@google.com>
2020-05-26[dev.link] cmd/link: move asmb2 elf to generic handlingJeremy Faller
Change-Id: Ic3e90793f0ce49909c4f76df1272b25a1d61ebdf Reviewed-on: https://go-review.googlesource.com/c/go/+/234887 Reviewed-by: Cherry Zhang <cherryyz@google.com>
2020-05-26[dev.link] cmd/link: move plan9 header out of architecturesJeremy Faller
Change-Id: I7ccd14e8faa84085e976d23f83b822c05ee6a0ee Reviewed-on: https://go-review.googlesource.com/c/go/+/234877 Run-TryBot: Jeremy Faller <jeremy@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Than McIntosh <thanm@google.com> Reviewed-by: Cherry Zhang <cherryyz@google.com>
2020-05-21[dev.link] cmd/link: remove duplicate asmb codeJeremy Faller
Lots of the architecture specific code for asmb() is very simimar. As such, move to a common function. Change-Id: Id1fd50ee7bfa1bc9978e3f42ad08914b04cd677b Reviewed-on: https://go-review.googlesource.com/c/go/+/234683 Run-TryBot: Jeremy Faller <jeremy@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Than McIntosh <thanm@google.com> Reviewed-by: Cherry Zhang <cherryyz@google.com>
2020-05-18[dev.link] cmd/link: remove "2" from namesCherry Zhang
Change-Id: I203caaf9cbe7136cf2060de7dc91c28f6ced1ee2 Reviewed-on: https://go-review.googlesource.com/c/go/+/234038 Run-TryBot: Cherry Zhang <cherryyz@google.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Than McIntosh <thanm@google.com> Reviewed-by: Jeremy Faller <jeremy@golang.org>
2020-05-13[dev.link] cmd/link: rename adddynrel2 back to adddynrelThan McIntosh
Minor renaming cleanup to get rid of a couple of old sym.Symbol adddynrel helpers and rename the current crop of adddynrel2 methods/functions back to adddynrel. Change-Id: I67e76decff84d603ef765f3b6a0cd78c7f3743ec Reviewed-on: https://go-review.googlesource.com/c/go/+/233523 Run-TryBot: Than McIntosh <thanm@google.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Cherry Zhang <cherryyz@google.com>
2020-05-12[dev.link] cmd/link: expand architecture support for elf asmb2 pathThan McIntosh
Adds in support for remaining architectures to the linker's ELF asmb2 path, along with deleting most of the older sym.Symbol based code. Change-Id: I67c96525db72b7d6dd3187cf2b9f6faddc296291 Reviewed-on: https://go-review.googlesource.com/c/go/+/233362 Reviewed-by: Cherry Zhang <cherryyz@google.com>
2020-05-11[dev.link] cmd/link: convert asmb2 pass to new style on Plan 9Cherry Zhang
And no longer do loadlibfull there. Change-Id: I0359f40123f6b0b7855d6fced5876fd4da9c6130 Reviewed-on: https://go-review.googlesource.com/c/go/+/233337 Run-TryBot: Cherry Zhang <cherryyz@google.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Than McIntosh <thanm@google.com>
2020-05-11[dev.link] cmd/link: convert asmb2 pass to new style on WasmCherry Zhang
And no longer do loadlibfull there. Change-Id: I3dd41d25f5f7db4ef1d112559299e322acb32641 Reviewed-on: https://go-review.googlesource.com/c/go/+/232987 Run-TryBot: Cherry Zhang <cherryyz@google.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Than McIntosh <thanm@google.com>
2020-05-08[dev.link] cmd/link: delete old reloc passCherry Zhang
We use the new one everywhere now. Change-Id: Ic9b1314e71e4666500cbf1689bb93839e040682a Reviewed-on: https://go-review.googlesource.com/c/go/+/232982 Run-TryBot: Cherry Zhang <cherryyz@google.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Jeremy Faller <jeremy@golang.org> Reviewed-by: Than McIntosh <thanm@google.com>
2020-05-06[dev.link] cmd/link: convert asmb2 pass to new style on darwinCherry Zhang
Now we no longer do loadlibfull on darwin. While here, remove residual darwin/386 and darwin/arm code. Change-Id: I6efdcd81baeeca29d1fe91c4fab0cc8241a58e2d Reviewed-on: https://go-review.googlesource.com/c/go/+/232597 Run-TryBot: Cherry Zhang <cherryyz@google.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Jeremy Faller <jeremy@golang.org> Reviewed-by: Than McIntosh <thanm@google.com>
2020-05-04[dev.link] cmd/link: use new reloc pass on MIPS64Cherry Zhang
Change-Id: I1c5da63d88e917877c70c1783bb350a697d6e207 Reviewed-on: https://go-review.googlesource.com/c/go/+/231937 Reviewed-by: Than McIntosh <thanm@google.com>
2020-05-01[dev.link] cmd/link: enforce single level of 'outer' symThan McIntosh
Add code to the loader to enforce the invariant that there is only a single level of 'outer' symbol nesting. That is, if outer(X) = Y, then outer(Y) is always zero. Revise foldSubSymbolOffset based on the new invariant, allowing it to be inlined, and then fix the various "for s.Outer != nil" loops in the linker to just use an "if" instead of a loop. Change-Id: Ib895702bc6de52718248f09a5368b84cb2e0a3fa Reviewed-on: https://go-review.googlesource.com/c/go/+/231137 Run-TryBot: Than McIntosh <thanm@google.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Cherry Zhang <cherryyz@google.com>
2020-04-30[dev.link] cmd/link: use more compact representation for external relocationsCherry Zhang
Currently, for external relocations, the ExtReloc structure contains all the fields of the relocation. In fact, many of the fields are the same with the original relocation. So, instead, we can just use an index to reference the original relocation and not expand the fields. There is one place where we modify relocation type: changing R_DWARFSECTREF to R_ADDR. Get away with it by changing downstreams. It also makes it easier to retrieve the reloc variant. This reduces some allocation. Linking cmd/compile with external linking, name old alloc/op new alloc/op delta Reloc_GC 34.1MB ± 0% 22.7MB ± 0% -33.30% (p=0.000 n=5+4) Change-Id: Id08a89ed2aee705296886d3b95014b806a0d55cf Reviewed-on: https://go-review.googlesource.com/c/go/+/231217 Run-TryBot: Cherry Zhang <cherryyz@google.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Than McIntosh <thanm@google.com> Reviewed-by: Jeremy Faller <jeremy@golang.org>
2020-04-28[dev.link] cmd/link: remove elf sym fields from sym.SymbolThan McIntosh
Remove the "ElfSym" and "LocalElfSym" fields from sym.Symbol, replacing uses with loader method calls as needed. Change-Id: I3828f13203ece2bdc03eeb09ab37a5c94e21a726 Reviewed-on: https://go-review.googlesource.com/c/go/+/230462 Reviewed-by: Cherry Zhang <cherryyz@google.com>
2020-04-28[dev.link] cmd/link: write data sections to heap in Asmb on WasmCherry Zhang
Make Wasm more like other architectures, writing data sections to heap in Asmb instead of Asmb2. Then we can remove the copy-on-write logic in applying relocations. Change-Id: I26d5315ea9fba032fe4bdb9b5c7fe483611c4373 Reviewed-on: https://go-review.googlesource.com/c/go/+/230465 Run-TryBot: Cherry Zhang <cherryyz@google.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Than McIntosh <thanm@google.com> Reviewed-by: Jeremy Faller <jeremy@golang.org>
2020-04-20[dev.link] cmd/link: remove buffered file I/O from OutBufJeremy Faller
Recreation of CL 228317. The problem with that original CL was a late requested change, reordering reloc and asmb, resulting in symbols having stale pointers to their data. I've fixed this by preallocating the heap variable in OutBuf for platforms w/o mmap. Change-Id: Icdb392ac2c8d6518830f4c84cf422e78b8ab68c7 Reviewed-on: https://go-review.googlesource.com/c/go/+/228782 Run-TryBot: Jeremy Faller <jeremy@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Than McIntosh <thanm@google.com>
2020-04-17Revert "[dev.link] cmd/link: remove buffered file I/O from OutBuf"Jeremy Faller
This reverts commit b2def42d9efcf4540656e26632b744f8e7436814. Reason for revert: trybots failing Change-Id: I920be6d8de158b1e513154ac0eb0c8fa0cffa9f4 Reviewed-on: https://go-review.googlesource.com/c/go/+/228657 Reviewed-by: Than McIntosh <thanm@google.com> Reviewed-by: Cherry Zhang <cherryyz@google.com>
2020-04-16[dev.link] cmd/link: remove buffered file I/O from OutBufJeremy Faller
Change-Id: I72b1e57631fe4a31597fd0452ee1beb14378febb Reviewed-on: https://go-review.googlesource.com/c/go/+/228317 Run-TryBot: Jeremy Faller <jeremy@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Than McIntosh <thanm@google.com>
2020-04-06[dev.link] cmd/link: begin converting gentext to loader APIsThan McIntosh
Begin the job of converting the linker's "gentext" phase over to use loader APIs. This patch includes most architectures except for s390x and PPC (these will be added in subsequent patches, since they require a couple of loader changes first). Change-Id: Ic7f55c207dcdbbba657330ef007a72ff7c837416 Reviewed-on: https://go-review.googlesource.com/c/go/+/227017 Reviewed-by: Jeremy Faller <jeremy@golang.org> Reviewed-by: Cherry Zhang <cherryyz@google.com>
2020-03-30[dev.link] cmd/link: make asmb parallel across all platformsJeremy Faller
Numbers for x86: Asmb 54.8ms ±15% 12.1ms ±28% -78.02% (p=0.000 n=10+10) TotalTime 545ms ± 3% 515ms ± 4% -5.42% (p=0.000 n=10+10) Change-Id: I8fc17f7ccdf83fbd70cf7d27b44f41f9db9c9922 Reviewed-on: https://go-review.googlesource.com/c/go/+/224419 Run-TryBot: Jeremy Faller <jeremy@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Than McIntosh <thanm@google.com> Reviewed-by: Cherry Zhang <cherryyz@google.com>
2020-03-25[dev.link] cmd/link: pass loader to relocation functionsCherry Zhang
It is needed in Xcoffadddynrel. And it will be needed once we move more things to new style (the sym.Symbol parameters will also need to change). Change-Id: Ie12683f9b44e21f1e6ea711bf2f4c5c32282e5b3 Reviewed-on: https://go-review.googlesource.com/c/go/+/225203 Reviewed-by: Jeremy Faller <jeremy@golang.org> Reviewed-by: Than McIntosh <thanm@google.com>
2020-03-19[dev.link] cmd/link: remove *Link from some arch functionsJeremy Faller
Change-Id: Ia7f9a999af5285885987b83a877b205b274342a6 Reviewed-on: https://go-review.googlesource.com/c/go/+/222306 Run-TryBot: Jeremy Faller <jeremy@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Than McIntosh <thanm@google.com>
2020-03-19[dev.link] cmd/link: eliminate usage of *Link in arch funcsJeremy Faller
Change-Id: I10e6b266ff3a1238d1b86a9b39debb13f5a04e55 Reviewed-on: https://go-review.googlesource.com/c/go/+/222159 Run-TryBot: Jeremy Faller <jeremy@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Than McIntosh <thanm@google.com>
2020-03-11[dev.link] cmd/link: convert doelf to new styleCherry Zhang
Change-Id: I448fe632ae73ddcb79c05793c96f48e358060305 Reviewed-on: https://go-review.googlesource.com/c/go/+/222977 Reviewed-by: Than McIntosh <thanm@google.com>