1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31 package mips64
32
33 import (
34 "cmd/internal/objabi"
35 "cmd/internal/sys"
36 "cmd/link/internal/ld"
37 "internal/buildcfg"
38 )
39
40 func Init() (*sys.Arch, ld.Arch) {
41 arch := sys.ArchMIPS64
42 musl := "/lib/ld-musl-mips64.so.1"
43 if buildcfg.GOARCH == "mips64le" {
44 arch = sys.ArchMIPS64LE
45 musl = "/lib/ld-musl-mips64el.so.1"
46 }
47
48 theArch := ld.Arch{
49 Funcalign: funcAlign,
50 Maxalign: maxAlign,
51 Minalign: minAlign,
52 Dwarfregsp: dwarfRegSP,
53 Dwarfreglr: dwarfRegLR,
54 Adddynrel: adddynrel,
55 Archinit: archinit,
56 Archreloc: archreloc,
57 Archrelocvariant: archrelocvariant,
58 Extreloc: extreloc,
59 Gentext: gentext,
60 Machoreloc1: machoreloc1,
61
62 ELF: ld.ELFArch{
63 Linuxdynld: "/lib64/ld64.so.1",
64 LinuxdynldMusl: musl,
65 Freebsddynld: "XXX",
66 Openbsddynld: "/usr/libexec/ld.so",
67 Netbsddynld: "XXX",
68 Dragonflydynld: "XXX",
69 Solarisdynld: "XXX",
70
71 Reloc1: elfreloc1,
72 RelocSize: 24,
73 SetupPLT: elfsetupplt,
74
75
76
77 DynamicReadOnly: true,
78 },
79 }
80
81 return arch, theArch
82 }
83
84 func archinit(ctxt *ld.Link) {
85 switch ctxt.HeadType {
86 default:
87 ld.Exitf("unknown -H option: %v", ctxt.HeadType)
88
89 case objabi.Hplan9:
90 ld.HEADR = 32
91 if *ld.FlagRound == -1 {
92 *ld.FlagRound = 16 * 1024
93 }
94 if *ld.FlagTextAddr == -1 {
95 *ld.FlagTextAddr = ld.Rnd(16*1024, *ld.FlagRound) + int64(ld.HEADR)
96 }
97
98 case objabi.Hlinux,
99 objabi.Hopenbsd:
100 ld.Elfinit(ctxt)
101 ld.HEADR = ld.ELFRESERVE
102 if *ld.FlagRound == -1 {
103 *ld.FlagRound = 0x10000
104 }
105 if *ld.FlagTextAddr == -1 {
106 *ld.FlagTextAddr = ld.Rnd(0x10000, *ld.FlagRound) + int64(ld.HEADR)
107 }
108 }
109
110 dynSymCount = 0
111 gotLocalCount = 0
112 gotSymIndex = 0
113 }
114
View as plain text