mirror of
https://github.com/golang/go.git
synced 2025-05-15 20:34:38 +00:00
[dev.link] cmd/link: gofmt
I somehow messed up my local environment for the pre-commit hook. Fix the format. Change-Id: I6161ad1fce7714e8f311be5315d854f8c9bd7664 Reviewed-on: https://go-review.googlesource.com/c/go/+/227579 Run-TryBot: Cherry Zhang <cherryyz@google.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Than McIntosh <thanm@google.com>
This commit is contained in:
parent
850c602ed6
commit
dc6d452615
@ -520,11 +520,11 @@ func gentramp(arch *sys.Arch, linkmode ld.LinkMode, ldr *loader.Loader, tramp *l
|
|||||||
|
|
||||||
if linkmode == ld.LinkExternal {
|
if linkmode == ld.LinkExternal {
|
||||||
r := loader.Reloc{
|
r := loader.Reloc{
|
||||||
Off: 8,
|
Off: 8,
|
||||||
Type: objabi.R_ADDR,
|
Type: objabi.R_ADDR,
|
||||||
Size: 4,
|
Size: 4,
|
||||||
Sym: target,
|
Sym: target,
|
||||||
Add: offset,
|
Add: offset,
|
||||||
}
|
}
|
||||||
tramp.AddReloc(r)
|
tramp.AddReloc(r)
|
||||||
}
|
}
|
||||||
@ -545,11 +545,11 @@ func gentramppic(arch *sys.Arch, tramp *loader.SymbolBuilder, target loader.Sym,
|
|||||||
tramp.SetData(P)
|
tramp.SetData(P)
|
||||||
|
|
||||||
r := loader.Reloc{
|
r := loader.Reloc{
|
||||||
Off: 12,
|
Off: 12,
|
||||||
Type: objabi.R_PCREL,
|
Type: objabi.R_PCREL,
|
||||||
Size: 4,
|
Size: 4,
|
||||||
Sym: target,
|
Sym: target,
|
||||||
Add: offset + 4,
|
Add: offset + 4,
|
||||||
}
|
}
|
||||||
tramp.AddReloc(r)
|
tramp.AddReloc(r)
|
||||||
}
|
}
|
||||||
@ -583,11 +583,11 @@ func gentrampdyn(arch *sys.Arch, tramp *loader.SymbolBuilder, target loader.Sym,
|
|||||||
tramp.SetData(P)
|
tramp.SetData(P)
|
||||||
|
|
||||||
r := loader.Reloc{
|
r := loader.Reloc{
|
||||||
Off: 16,
|
Off: 16,
|
||||||
Type: objabi.R_GOTPCREL,
|
Type: objabi.R_GOTPCREL,
|
||||||
Size: 4,
|
Size: 4,
|
||||||
Sym: target,
|
Sym: target,
|
||||||
Add: 8,
|
Add: 8,
|
||||||
}
|
}
|
||||||
if offset != 0 {
|
if offset != 0 {
|
||||||
// increase reloc offset by 4 as we inserted an ADD instruction
|
// increase reloc offset by 4 as we inserted an ADD instruction
|
||||||
|
@ -736,11 +736,11 @@ func gentramp(ctxt *ld.Link, ldr *loader.Loader, tramp *loader.SymbolBuilder, ta
|
|||||||
toctramp.AddAddr(ctxt.Arch, target)
|
toctramp.AddAddr(ctxt.Arch, target)
|
||||||
|
|
||||||
r := loader.Reloc{
|
r := loader.Reloc{
|
||||||
Off: 0,
|
Off: 0,
|
||||||
Type: objabi.R_ADDRPOWER_TOCREL_DS,
|
Type: objabi.R_ADDRPOWER_TOCREL_DS,
|
||||||
Size: 8, // generates 2 relocations: HA + LO
|
Size: 8, // generates 2 relocations: HA + LO
|
||||||
Sym: toctramp.Sym(),
|
Sym: toctramp.Sym(),
|
||||||
Add: offset,
|
Add: offset,
|
||||||
}
|
}
|
||||||
tramp.AddReloc(r)
|
tramp.AddReloc(r)
|
||||||
} else {
|
} else {
|
||||||
@ -754,11 +754,11 @@ func gentramp(ctxt *ld.Link, ldr *loader.Loader, tramp *loader.SymbolBuilder, ta
|
|||||||
// relocated using LO and HA
|
// relocated using LO and HA
|
||||||
if ctxt.IsExternal() {
|
if ctxt.IsExternal() {
|
||||||
r := loader.Reloc{
|
r := loader.Reloc{
|
||||||
Off: 0,
|
Off: 0,
|
||||||
Type: objabi.R_ADDRPOWER,
|
Type: objabi.R_ADDRPOWER,
|
||||||
Size: 8, // generates 2 relocations: HA + LO
|
Size: 8, // generates 2 relocations: HA + LO
|
||||||
Sym: target,
|
Sym: target,
|
||||||
Add: offset,
|
Add: offset,
|
||||||
}
|
}
|
||||||
tramp.AddReloc(r)
|
tramp.AddReloc(r)
|
||||||
} else {
|
} else {
|
||||||
|
@ -87,7 +87,7 @@ func assignAddress(ldr *loader.Loader, sect *sym.Section, n int, s loader.Sym, v
|
|||||||
// However, there is no PC register, only PC_F and PC_B. PC_F denotes the function,
|
// However, there is no PC register, only PC_F and PC_B. PC_F denotes the function,
|
||||||
// PC_B the resume point inside of that function. The entry of the function has PC_B = 0.
|
// PC_B the resume point inside of that function. The entry of the function has PC_B = 0.
|
||||||
ldr.SetSymSect(s, sect)
|
ldr.SetSymSect(s, sect)
|
||||||
ldr.SetSymValue(s, int64(funcValueOffset+va/ld.MINFUNC) << 16) // va starts at zero
|
ldr.SetSymValue(s, int64(funcValueOffset+va/ld.MINFUNC)<<16) // va starts at zero
|
||||||
va += uint64(ld.MINFUNC)
|
va += uint64(ld.MINFUNC)
|
||||||
return sect, n, va
|
return sect, n, va
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user