]> Cypherpunks.ru repositories - gostls13.git/commit
[dev.link] cmd/link/internal/loader: add SetRelocType symbolbuilder method
authorThan McIntosh <thanm@google.com>
Thu, 23 Apr 2020 13:18:44 +0000 (09:18 -0400)
committerThan McIntosh <thanm@google.com>
Fri, 24 Apr 2020 13:41:32 +0000 (13:41 +0000)
commit442fd182fba66a11f9cbe3321217e8b4618fcfc7
treee68ba0a85e40df4e8c518c5f9536a2dc45b8c54c
parentadea6a90e361629d20a68400c0c5cdcdfcdf087e
[dev.link] cmd/link/internal/loader: add SetRelocType symbolbuilder method

Clients may need to invoke the loader.Reloc2.SetType method to reset
the type of a relocation from external flavor to internal flavor,
meaning that the external type add-in needs to be zeroed (this is
needed when adding dynsym entries).

Add a new SymbolBuider method to support mutating the type of a reloc
for an external symbol, so that the external type can be changed as
well (Reloc2 doesn't have access to that). Also add similar methods
for updating target symbol and addend, so as to have a consistent
interface for ext reloc mutation.

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