File go-1.4.3-support-new-386_amd64-relocations.patch of Package go1.4

Index: go/src/cmd/6l/asm.c
===================================================================
--- go.orig/src/cmd/6l/asm.c
+++ go/src/cmd/6l/asm.c
@@ -118,6 +118,8 @@ adddynrel(LSym *s, Reloc *r)
 		return;
 	
 	case 256 + R_X86_64_GOTPCREL:
+	case 256 + R_X86_64_GOTPCRELX:
+	case 256 + R_X86_64_REX_GOTPCRELX:
 		if(targ->type != SDYNIMPORT) {
 			// have symbol
 			if(r->off >= 2 && s->p[r->off-2] == 0x8b) {
Index: go/src/cmd/8l/asm.c
===================================================================
--- go.orig/src/cmd/8l/asm.c
+++ go/src/cmd/8l/asm.c
@@ -115,6 +115,7 @@ adddynrel(LSym *s, Reloc *r)
 		return;		
 	
 	case 256 + R_386_GOT32:
+	case 256 + R_386_GOT32X:
 		if(targ->type != SDYNIMPORT) {
 			// have symbol
 			if(r->off >= 2 && s->p[r->off-2] == 0x8b) {
Index: go/src/cmd/ld/elf.h
===================================================================
--- go.orig/src/cmd/ld/elf.h
+++ go/src/cmd/ld/elf.h
@@ -502,8 +502,9 @@ typedef struct {
 #define	R_X86_64_DTPOFF32 21	/* Offset in TLS block */
 #define	R_X86_64_GOTTPOFF 22	/* PC relative offset to IE GOT entry */
 #define	R_X86_64_TPOFF32 23	/* Offset in static TLS block */
-
-#define	R_X86_64_COUNT	24	/* Count of defined relocation types. */
+#define R_X86_64_GOTPCRELX 41
+#define R_X86_64_REX_GOTPCRELX 42
+#define	R_X86_64_COUNT	26	/* Count of defined relocation types. */
 
 
 #define	R_ALPHA_NONE		0	/* No reloc */
@@ -612,8 +613,8 @@ typedef struct {
 #define	R_386_TLS_DTPMOD32 35	/* GOT entry containing TLS index */
 #define	R_386_TLS_DTPOFF32 36	/* GOT entry containing TLS offset */
 #define	R_386_TLS_TPOFF32 37	/* GOT entry of -ve static TLS offset */
-
-#define	R_386_COUNT	38	/* Count of defined relocation types. */
+#define R_386_GOT32X 43
+#define	R_386_COUNT	39	/* Count of defined relocation types. */
 
 #define	R_PPC_NONE		0	/* No relocation. */
 #define	R_PPC_ADDR32		1
Index: go/src/cmd/ld/ldelf.c
===================================================================
--- go.orig/src/cmd/ld/ldelf.c
+++ go/src/cmd/ld/ldelf.c
@@ -888,12 +888,15 @@ reltype(char *pn, int elftype, uchar *si
 	case R('6', R_X86_64_PC32):
 	case R('6', R_X86_64_PLT32):
 	case R('6', R_X86_64_GOTPCREL):
+	case R('6', R_X86_64_GOTPCRELX):
+	case R('6', R_X86_64_REX_GOTPCRELX):
 	case R('8', R_386_32):
 	case R('8', R_386_PC32):
 	case R('8', R_386_GOT32):
 	case R('8', R_386_PLT32):
 	case R('8', R_386_GOTOFF):
 	case R('8', R_386_GOTPC):
+	case R('8', R_386_GOT32X):
 		*siz = 4;
 		break;
 	case R('6', R_X86_64_64):
openSUSE Build Service is sponsored by