-
- Downloads
[dev.link] cmd/link: support updates to contents of obj-based Syms
Add in the hooks to SymbolBuilder and to the loader to allow the linker to make modifications to a non-external symbol (e.g. a sym whose index is less than loader.extStart). The basic idea is to manufacture a new external symbol with the same name and version, then import the old symbol's content (type, data, relocations, etc) into the payload struct for the new symbol, and finally redirect the name lookup tables to target the new sym for the specified name/version. This change is needed in order to convert over the host object loaders to avoid use of sym.Symbol. Change-Id: I79cd42b23794e830bbdbcbcd2c500c35c351f01f Reviewed-on: https://go-review.googlesource.com/c/go/+/211897 Reviewed-by:Cherry Zhang <cherryyz@google.com>
Showing
- src/cmd/link/internal/loader/loader.go 215 additions, 59 deletionssrc/cmd/link/internal/loader/loader.go
- src/cmd/link/internal/loader/loader_test.go 28 additions, 21 deletionssrc/cmd/link/internal/loader/loader_test.go
- src/cmd/link/internal/loader/symbolbuilder.go 19 additions, 6 deletionssrc/cmd/link/internal/loader/symbolbuilder.go
Loading
Please register or sign in to comment