summaryrefslogtreecommitdiffstats
path: root/recipes-devtools
diff options
context:
space:
mode:
authorPaul Gortmaker <paul.gortmaker@windriver.com>2016-04-22 12:50:06 -0400
committerBruce Ashfield <bruce.ashfield@windriver.com>2016-04-22 12:51:23 -0400
commit7735217d666dc1528ea2e1ace350d26713f76ff0 (patch)
treeb7775ef8a3761328310f89d9197856864835a404 /recipes-devtools
parentecd6adcb8253752cb3346d448281051b1cfce75e (diff)
downloadmeta-virtualization-7735217d666dc1528ea2e1ace350d26713f76ff0.tar.gz
go-cross: add relocation fix to 1.4 for new binutils.
Add relocation fix as documented in contained commit log, so that we can build with newer binutils, as per the ones we get via the self hosted builder and things like build-appliance. Fixes: | go-native/1.4.3-r0/go/pkg/linux_amd64/runtime/cgo.a(_all.o): unknown relocation type 42; compiled without -fpic? | go-native/1.4.3-r0/go/pkg/linux_amd64/runtime/cgo.a(_all.o): unknown relocation type 42; compiled without -fpic? | runtime/cgo(.text): unexpected relocation type 298 | runtime/cgo(.text): unexpected relocation type 298 | # cmd/go | go-native/1.4.3-r0/go/pkg/linux_amd64/runtime/cgo.a(_all.o): unknown relocation type 42; compiled without -fpic? | go-native/1.4.3-r0/go/pkg/linux_amd64/runtime/cgo.a(_all.o): unknown relocation type 42; compiled without -fpic? | runtime/cgo(.text): unexpected relocation type 298 | runtime/cgo(.text): unexpected relocation type 298 | WARNING: go-native/1.4.3-r0/temp/run.do_compile.30243:1 exit 2 from './make.bash --host-only' | ERROR: Function failed: do_compile (log file is located at go-native/1.4.3-r0/temp/log.do_compile.30243) ERROR: Task 6 (meta-virtualization/recipes-devtools/go-cross/go-native_1.4.bb, do_compile) failed with exit code '1' Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
Diffstat (limited to 'recipes-devtools')
-rw-r--r--recipes-devtools/go-cross/go-1.4.inc1
-rw-r--r--recipes-devtools/go-cross/go-1.4/go-cross-backport-cmd-link-support-new-386-amd64-rel.patch223
2 files changed, 224 insertions, 0 deletions
diff --git a/recipes-devtools/go-cross/go-1.4.inc b/recipes-devtools/go-cross/go-1.4.inc
index 898ad94b..a65459fc 100644
--- a/recipes-devtools/go-cross/go-1.4.inc
+++ b/recipes-devtools/go-cross/go-1.4.inc
@@ -6,6 +6,7 @@ FILESEXTRAPATHS_prepend := "${FILE_DIRNAME}/go-${GO_BASEVERSION}:"
6 6
7SRC_URI += "\ 7SRC_URI += "\
8 file://016-armhf-elf-header.patch \ 8 file://016-armhf-elf-header.patch \
9 file://go-cross-backport-cmd-link-support-new-386-amd64-rel.patch \
9 file://syslog.patch \ 10 file://syslog.patch \
10" 11"
11 12
diff --git a/recipes-devtools/go-cross/go-1.4/go-cross-backport-cmd-link-support-new-386-amd64-rel.patch b/recipes-devtools/go-cross/go-1.4/go-cross-backport-cmd-link-support-new-386-amd64-rel.patch
new file mode 100644
index 00000000..de3f49c0
--- /dev/null
+++ b/recipes-devtools/go-cross/go-1.4/go-cross-backport-cmd-link-support-new-386-amd64-rel.patch
@@ -0,0 +1,223 @@
1From d6eefad445831c161fca130f9bdf7b3848aac23c Mon Sep 17 00:00:00 2001
2From: Paul Gortmaker <paul.gortmaker@windriver.com>
3Date: Tue, 29 Mar 2016 21:14:33 -0400
4Subject: [PATCH] go-cross: backport "cmd/link: support new 386/amd64
5 relocations"
6
7Newer binutils won't support building older go-1.4.3 as per:
8
9https://github.com/golang/go/issues/13114
10
11Upstream commit 914db9f060b1fd3eb1f74d48f3bd46a73d4ae9c7 (see subj)
12was identified as the fix and nominated for 1.4.4 but that release
13never happened. The paths in 1.4.3 aren't the same as go1.6beta1~662
14where this commit appeared, but the NetBSD folks indicated what a
151.4.3 backport would look like here: https://gnats.netbsd.org/50777
16
17This is based on that, but without the BSD wrapper infrastructure
18layer that makes things look like patches of patches.
19
20Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
21
22diff --git a/src/cmd/6l/asm.c b/src/cmd/6l/asm.c
23index 18b5aa311981..2e9d339aef87 100644
24--- a/src/cmd/6l/asm.c
25+++ b/src/cmd/6l/asm.c
26@@ -118,6 +118,8 @@ adddynrel(LSym *s, Reloc *r)
27 return;
28
29 case 256 + R_X86_64_GOTPCREL:
30+ case 256 + R_X86_64_GOTPCRELX:
31+ case 256 + R_X86_64_REX_GOTPCRELX:
32 if(targ->type != SDYNIMPORT) {
33 // have symbol
34 if(r->off >= 2 && s->p[r->off-2] == 0x8b) {
35diff --git a/src/cmd/8l/asm.c b/src/cmd/8l/asm.c
36index 98c04240374f..cff29488e8af 100644
37--- a/src/cmd/8l/asm.c
38+++ b/src/cmd/8l/asm.c
39@@ -115,6 +115,7 @@ adddynrel(LSym *s, Reloc *r)
40 return;
41
42 case 256 + R_386_GOT32:
43+ case 256 + R_386_GOT32X:
44 if(targ->type != SDYNIMPORT) {
45 // have symbol
46 if(r->off >= 2 && s->p[r->off-2] == 0x8b) {
47diff --git a/src/cmd/ld/elf.h b/src/cmd/ld/elf.h
48index e84d996f2596..bbf2cfaa3cc0 100644
49--- a/src/cmd/ld/elf.h
50+++ b/src/cmd/ld/elf.h
51@@ -478,32 +478,47 @@ typedef struct {
52 * Relocation types.
53 */
54
55-#define R_X86_64_NONE 0 /* No relocation. */
56-#define R_X86_64_64 1 /* Add 64 bit symbol value. */
57-#define R_X86_64_PC32 2 /* PC-relative 32 bit signed sym value. */
58-#define R_X86_64_GOT32 3 /* PC-relative 32 bit GOT offset. */
59-#define R_X86_64_PLT32 4 /* PC-relative 32 bit PLT offset. */
60-#define R_X86_64_COPY 5 /* Copy data from shared object. */
61-#define R_X86_64_GLOB_DAT 6 /* Set GOT entry to data address. */
62-#define R_X86_64_JMP_SLOT 7 /* Set GOT entry to code address. */
63-#define R_X86_64_RELATIVE 8 /* Add load address of shared object. */
64-#define R_X86_64_GOTPCREL 9 /* Add 32 bit signed pcrel offset to GOT. */
65-#define R_X86_64_32 10 /* Add 32 bit zero extended symbol value */
66-#define R_X86_64_32S 11 /* Add 32 bit sign extended symbol value */
67-#define R_X86_64_16 12 /* Add 16 bit zero extended symbol value */
68-#define R_X86_64_PC16 13 /* Add 16 bit signed extended pc relative symbol value */
69-#define R_X86_64_8 14 /* Add 8 bit zero extended symbol value */
70-#define R_X86_64_PC8 15 /* Add 8 bit signed extended pc relative symbol value */
71-#define R_X86_64_DTPMOD64 16 /* ID of module containing symbol */
72-#define R_X86_64_DTPOFF64 17 /* Offset in TLS block */
73-#define R_X86_64_TPOFF64 18 /* Offset in static TLS block */
74-#define R_X86_64_TLSGD 19 /* PC relative offset to GD GOT entry */
75-#define R_X86_64_TLSLD 20 /* PC relative offset to LD GOT entry */
76-#define R_X86_64_DTPOFF32 21 /* Offset in TLS block */
77-#define R_X86_64_GOTTPOFF 22 /* PC relative offset to IE GOT entry */
78-#define R_X86_64_TPOFF32 23 /* Offset in static TLS block */
79-
80-#define R_X86_64_COUNT 24 /* Count of defined relocation types. */
81+#define R_X86_64_NONE 0
82+#define R_X86_64_64 1
83+#define R_X86_64_PC32 2
84+#define R_X86_64_GOT32 3
85+#define R_X86_64_PLT32 4
86+#define R_X86_64_COPY 5
87+#define R_X86_64_GLOB_DAT 6
88+#define R_X86_64_JMP_SLOT 7
89+#define R_X86_64_RELATIVE 8
90+#define R_X86_64_GOTPCREL 9
91+#define R_X86_64_32 10
92+#define R_X86_64_32S 11
93+#define R_X86_64_16 12
94+#define R_X86_64_PC16 13
95+#define R_X86_64_8 14
96+#define R_X86_64_PC8 15
97+#define R_X86_64_DTPMOD64 16
98+#define R_X86_64_DTPOFF64 17
99+#define R_X86_64_TPOFF64 18
100+#define R_X86_64_TLSGD 19
101+#define R_X86_64_TLSLD 20
102+#define R_X86_64_DTPOFF32 21
103+#define R_X86_64_GOTTPOFF 22
104+#define R_X86_64_TPOFF32 23
105+#define R_X86_64_PC64 24
106+#define R_X86_64_GOTOFF64 25
107+#define R_X86_64_GOTPC32 26
108+#define R_X86_64_GOT64 27
109+#define R_X86_64_GOTPCREL64 28
110+#define R_X86_64_GOTPC64 29
111+#define R_X86_64_GOTPLT64 30
112+#define R_X86_64_PLTOFF64 31
113+#define R_X86_64_SIZE32 32
114+#define R_X86_64_SIZE64 33
115+#define R_X86_64_GOTPC32_TLSDEC 34
116+#define R_X86_64_TLSDESC_CALL 35
117+#define R_X86_64_TLSDESC 36
118+#define R_X86_64_IRELATIVE 37
119+#define R_X86_64_PC32_BND 40
120+#define R_X86_64_GOTPCRELX 41
121+#define R_X86_64_REX_GOTPCRELX 42
122
123
124 #define R_ALPHA_NONE 0 /* No reloc */
125@@ -581,39 +596,42 @@ typedef struct {
126 #define R_ARM_COUNT 38 /* Count of defined relocation types. */
127
128
129-#define R_386_NONE 0 /* No relocation. */
130-#define R_386_32 1 /* Add symbol value. */
131-#define R_386_PC32 2 /* Add PC-relative symbol value. */
132-#define R_386_GOT32 3 /* Add PC-relative GOT offset. */
133-#define R_386_PLT32 4 /* Add PC-relative PLT offset. */
134-#define R_386_COPY 5 /* Copy data from shared object. */
135-#define R_386_GLOB_DAT 6 /* Set GOT entry to data address. */
136-#define R_386_JMP_SLOT 7 /* Set GOT entry to code address. */
137-#define R_386_RELATIVE 8 /* Add load address of shared object. */
138-#define R_386_GOTOFF 9 /* Add GOT-relative symbol address. */
139-#define R_386_GOTPC 10 /* Add PC-relative GOT table address. */
140-#define R_386_TLS_TPOFF 14 /* Negative offset in static TLS block */
141-#define R_386_TLS_IE 15 /* Absolute address of GOT for -ve static TLS */
142-#define R_386_TLS_GOTIE 16 /* GOT entry for negative static TLS block */
143-#define R_386_TLS_LE 17 /* Negative offset relative to static TLS */
144-#define R_386_TLS_GD 18 /* 32 bit offset to GOT (index,off) pair */
145-#define R_386_TLS_LDM 19 /* 32 bit offset to GOT (index,zero) pair */
146-#define R_386_TLS_GD_32 24 /* 32 bit offset to GOT (index,off) pair */
147-#define R_386_TLS_GD_PUSH 25 /* pushl instruction for Sun ABI GD sequence */
148-#define R_386_TLS_GD_CALL 26 /* call instruction for Sun ABI GD sequence */
149-#define R_386_TLS_GD_POP 27 /* popl instruction for Sun ABI GD sequence */
150-#define R_386_TLS_LDM_32 28 /* 32 bit offset to GOT (index,zero) pair */
151-#define R_386_TLS_LDM_PUSH 29 /* pushl instruction for Sun ABI LD sequence */
152-#define R_386_TLS_LDM_CALL 30 /* call instruction for Sun ABI LD sequence */
153-#define R_386_TLS_LDM_POP 31 /* popl instruction for Sun ABI LD sequence */
154-#define R_386_TLS_LDO_32 32 /* 32 bit offset from start of TLS block */
155-#define R_386_TLS_IE_32 33 /* 32 bit offset to GOT static TLS offset entry */
156-#define R_386_TLS_LE_32 34 /* 32 bit offset within static TLS block */
157-#define R_386_TLS_DTPMOD32 35 /* GOT entry containing TLS index */
158-#define R_386_TLS_DTPOFF32 36 /* GOT entry containing TLS offset */
159-#define R_386_TLS_TPOFF32 37 /* GOT entry of -ve static TLS offset */
160-
161-#define R_386_COUNT 38 /* Count of defined relocation types. */
162+#define R_386_NONE 0
163+#define R_386_32 1
164+#define R_386_PC32 2
165+#define R_386_GOT32 3
166+#define R_386_PLT32 4
167+#define R_386_COPY 5
168+#define R_386_GLOB_DAT 6
169+#define R_386_JMP_SLOT 7
170+#define R_386_RELATIVE 8
171+#define R_386_GOTOFF 9
172+#define R_386_GOTPC 10
173+#define R_386_TLS_TPOFF 14
174+#define R_386_TLS_IE 15
175+#define R_386_TLS_GOTIE 16
176+#define R_386_TLS_LE 17
177+#define R_386_TLS_GD 18
178+#define R_386_TLS_LDM 19
179+#define R_386_TLS_GD_32 24
180+#define R_386_TLS_GD_PUSH 25
181+#define R_386_TLS_GD_CALL 26
182+#define R_386_TLS_GD_POP 27
183+#define R_386_TLS_LDM_32 28
184+#define R_386_TLS_LDM_PUSH 29
185+#define R_386_TLS_LDM_CALL 30
186+#define R_386_TLS_LDM_POP 31
187+#define R_386_TLS_LDO_32 32
188+#define R_386_TLS_IE_32 33
189+#define R_386_TLS_LE_32 34
190+#define R_386_TLS_DTPMOD32 35
191+#define R_386_TLS_DTPOFF32 36
192+#define R_386_TLS_TPOFF32 37
193+#define R_386_TLS_GOTDESC 39
194+#define R_386_TLS_DESC_CALL 40
195+#define R_386_TLS_DESC 41
196+#define R_386_IRELATIVE 42
197+#define R_386_GOT32X 43
198
199 #define R_PPC_NONE 0 /* No relocation. */
200 #define R_PPC_ADDR32 1
201diff --git a/src/cmd/ld/ldelf.c b/src/cmd/ld/ldelf.c
202index dd5fa0d2a839..2e2fbd17377f 100644
203--- a/src/cmd/ld/ldelf.c
204+++ b/src/cmd/ld/ldelf.c
205@@ -888,12 +888,15 @@ reltype(char *pn, int elftype, uchar *siz)
206 case R('6', R_X86_64_PC32):
207 case R('6', R_X86_64_PLT32):
208 case R('6', R_X86_64_GOTPCREL):
209+ case R('6', R_X86_64_GOTPCRELX):
210+ case R('6', R_X86_64_REX_GOTPCRELX):
211 case R('8', R_386_32):
212 case R('8', R_386_PC32):
213 case R('8', R_386_GOT32):
214 case R('8', R_386_PLT32):
215 case R('8', R_386_GOTOFF):
216 case R('8', R_386_GOTPC):
217+ case R('8', R_386_GOT32X):
218 *siz = 4;
219 break;
220 case R('6', R_X86_64_64):
221--
2222.7.2
223