Browse Source

crisv32: use binutils 2.35 with a revert patch

Waldemar Brodkorb 3 years ago
parent
commit
e527fd268f

+ 0 - 5
target/config/Config.in.binutils

@@ -6,7 +6,6 @@ prompt "Binutils version"
 default ADK_TOOLCHAIN_BINUTILS_AVR32 if ADK_TARGET_ARCH_AVR32
 default ADK_TOOLCHAIN_BINUTILS_NDS32 if ADK_TARGET_ARCH_NDS32
 default ADK_TOOLCHAIN_BINUTILS_2_28 if ADK_TARGET_CPU_SH_J2
-default ADK_TOOLCHAIN_BINUTILS_2_29 if ADK_TARGET_ARCH_CRIS
 default ADK_TOOLCHAIN_BINUTILS_2_35
 
 config ADK_TOOLCHAIN_BINUTILS_GIT
@@ -21,10 +20,6 @@ config ADK_TOOLCHAIN_BINUTILS_2_35
 	depends on !ADK_TARGET_ARCH_NDS32
 	depends on !ADK_TARGET_CPU_SH_J2
 
-config ADK_TOOLCHAIN_BINUTILS_2_29
-	bool "2.29.1"
-	depends on ADK_TARGET_ARCH_CRIS # ld segfault with 2.30
-
 config ADK_TOOLCHAIN_BINUTILS_2_28
 	bool "2.28"
 	depends on ADK_TARGET_CPU_SH_J2

+ 0 - 7
toolchain/binutils/Makefile.inc

@@ -9,13 +9,6 @@ PKG_HASH:=		1b11659fb49e20e18db460d44485f09442c8c56d5df165de9461eb09c8302f85
 PKG_SITES:=		${MASTER_SITE_GNU:=binutils/}
 DISTFILES:=		${PKG_NAME}-${PKG_VERSION}.tar.xz
 endif
-ifeq ($(ADK_TOOLCHAIN_BINUTILS_2_29),y)
-PKG_VERSION:=		2.29.1
-PKG_RELEASE:=		1
-PKG_HASH:=		e7010a46969f9d3e53b650a518663f98a5dde3c3ae21b7d71e5e6803bc36b577
-PKG_SITES:=		${MASTER_SITE_GNU:=binutils/}
-DISTFILES:=		${PKG_NAME}-${PKG_VERSION}.tar.xz
-endif
 ifeq ($(ADK_TOOLCHAIN_BINUTILS_2_28),y)
 PKG_VERSION:=		2.28
 PKG_RELEASE:=		1

+ 39 - 0
toolchain/binutils/patches/2.35/cris32-revert.patch

@@ -0,0 +1,39 @@
+diff -Nur binutils-2.35.orig/bfd/elf32-cris.c binutils-2.35/bfd/elf32-cris.c
+--- binutils-2.35.orig/bfd/elf32-cris.c	2020-07-24 11:12:19.000000000 +0200
++++ binutils-2.35/bfd/elf32-cris.c	2020-09-07 10:56:01.075626508 +0200
+@@ -1021,7 +1021,6 @@
+       bfd_reloc_status_type r;
+       const char *symname = NULL;
+       enum elf_cris_reloc_type r_type;
+-      bfd_boolean resolved_to_zero;
+ 
+       r_type = ELF32_R_TYPE (rel->r_info);
+ 
+@@ -1134,9 +1133,6 @@
+       if (bfd_link_relocatable (info))
+ 	continue;
+ 
+-      resolved_to_zero = (h != NULL
+-			  && UNDEFWEAK_NO_DYNAMIC_RELOC (info, h));
+-
+       switch (r_type)
+ 	{
+ 	case R_CRIS_16_GOTPLT:
+@@ -1439,7 +1435,6 @@
+ 	case R_CRIS_16:
+ 	case R_CRIS_32:
+ 	  if (bfd_link_pic (info)
+-	      && !resolved_to_zero
+ 	      && r_symndx != STN_UNDEF
+ 	      && (input_section->flags & SEC_ALLOC) != 0
+ 	      && ((r_type != R_CRIS_8_PCREL
+@@ -3357,8 +3352,7 @@
+ 	     render the symbol local.  */
+ 
+ 	  /* No need to do anything if we're not creating a shared object.  */
+-	  if (! bfd_link_pic (info)
+-	      || UNDEFWEAK_NO_DYNAMIC_RELOC (info, h))
++	  if (! bfd_link_pic (info))
+ 	    break;
+ 
+ 	  /* We may need to create a reloc section in the dynobj and made room