From 0029978210c660c21803c355e10fb5faf2188430 Mon Sep 17 00:00:00 2001 From: Waldemar Brodkorb Date: Fri, 22 Sep 2017 22:40:44 +0200 Subject: binutils: update to 2.29.1 --- toolchain/binutils/Makefile.inc | 8 ++-- ...a-fix-memory-corruption-by-broken-sysregs.patch | 42 +++++++++++++++++++ ...a-ld-restore-old-section-sorting-behavior.patch | 48 ++++++++++++++++++++++ ...a-fix-memory-corruption-by-broken-sysregs.patch | 42 ------------------- ...a-ld-restore-old-section-sorting-behavior.patch | 48 ---------------------- toolchain/elf2flt/Makefile | 2 +- 6 files changed, 95 insertions(+), 95 deletions(-) create mode 100644 toolchain/binutils/patches/2.29.1/xtensa-fix-memory-corruption-by-broken-sysregs.patch create mode 100644 toolchain/binutils/patches/2.29.1/xtensa-ld-restore-old-section-sorting-behavior.patch delete mode 100644 toolchain/binutils/patches/2.29/xtensa-fix-memory-corruption-by-broken-sysregs.patch delete mode 100644 toolchain/binutils/patches/2.29/xtensa-ld-restore-old-section-sorting-behavior.patch (limited to 'toolchain') diff --git a/toolchain/binutils/Makefile.inc b/toolchain/binutils/Makefile.inc index 63b22e4d3..1262a882f 100644 --- a/toolchain/binutils/Makefile.inc +++ b/toolchain/binutils/Makefile.inc @@ -3,11 +3,11 @@ PKG_NAME:= binutils ifeq ($(ADK_TOOLCHAIN_BINUTILS_2_29),y) -PKG_VERSION:= 2.29 +PKG_VERSION:= 2.29.1 PKG_RELEASE:= 1 -PKG_HASH:= 172e8c89472cf52712fd23a9f14e9bca6182727fb45b0f8f482652a83d5a11b4 -PKG_SITES:= ${MASTER_SITE_GNU:=binutils/} -DISTFILES:= ${PKG_NAME}-${PKG_VERSION}.tar.gz +PKG_HASH:= 56507e116d070271325a216e13f125a1fad0fe2d23966aab5cfedd4a8e66b214 +PKG_SITES:= ftp://sourceware.org/pub/binutils/snapshots/ +DISTFILES:= ${PKG_NAME}-${PKG_VERSION}.tar.xz endif ifeq ($(ADK_TOOLCHAIN_BINUTILS_ARC),y) PKG_VERSION:= arc-2016.09-release diff --git a/toolchain/binutils/patches/2.29.1/xtensa-fix-memory-corruption-by-broken-sysregs.patch b/toolchain/binutils/patches/2.29.1/xtensa-fix-memory-corruption-by-broken-sysregs.patch new file mode 100644 index 000000000..30103ee05 --- /dev/null +++ b/toolchain/binutils/patches/2.29.1/xtensa-fix-memory-corruption-by-broken-sysregs.patch @@ -0,0 +1,42 @@ +From 3c8788dbb70b40e737d4b8e30cab81406e5c5091 Mon Sep 17 00:00:00 2001 +From: Max Filippov +Date: Wed, 2 Aug 2017 00:36:05 -0700 +Subject: [PATCH] xtensa: fix memory corruption by broken sysregs + +In some xtensa configurations there may be system/user registers in +xtensa-modules with negative index. ISA initialization for such config +may clobber heap and result in program termination. +Don't update lookup table entries for register with negative indices. +They are not directly accessible via RSR/WSR/XSR or RUR/WUR, so this +change should not affect processing of valid assembly/binary code. + +bfd/ +2017-08-02 Max Filippov + + * xtensa-isa.c (xtensa_isa_init): Don't update lookup table + entries for sysregs with negative indices. + +Signed-off-by: Max Filippov +--- +Backported from: d84ed528d4817b0ff854006b65a9f6ec75f0407a + + bfd/xtensa-isa.c | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +diff --git a/bfd/xtensa-isa.c b/bfd/xtensa-isa.c +index 8da75bea8109..8c6ee88fdeae 100644 +--- a/bfd/xtensa-isa.c ++++ b/bfd/xtensa-isa.c +@@ -292,7 +292,8 @@ xtensa_isa_init (xtensa_isa_status *errno_p, char **error_msg_p) + xtensa_sysreg_internal *sreg = &isa->sysregs[n]; + is_user = sreg->is_user; + +- isa->sysreg_table[is_user][sreg->number] = n; ++ if (sreg->number >= 0) ++ isa->sysreg_table[is_user][sreg->number] = n; + } + + /* Set up the interface lookup table. */ +-- +2.1.4 + diff --git a/toolchain/binutils/patches/2.29.1/xtensa-ld-restore-old-section-sorting-behavior.patch b/toolchain/binutils/patches/2.29.1/xtensa-ld-restore-old-section-sorting-behavior.patch new file mode 100644 index 000000000..b4118378d --- /dev/null +++ b/toolchain/binutils/patches/2.29.1/xtensa-ld-restore-old-section-sorting-behavior.patch @@ -0,0 +1,48 @@ +From 3a399127ead1ba3c8b8d0b9e7206fce39311ee72 Mon Sep 17 00:00:00 2001 +From: Max Filippov +Date: Wed, 2 Aug 2017 02:49:56 -0700 +Subject: [PATCH] xtensa: ld: restore old section sorting behavior + +With the recent change 535b785fb0c9 ("Don't compare boolean values +against TRUE or FALSE") the following assertion is observed when +linking with --sort-section,alignment option: + + BFD (GNU Binutils) 2.29 assertion fail elf32-xtensa.c:3965 + +It appears that xtensa linker only supported sorting sections by name, +and the code that checks for the section sorting type in +ld/emultempl/xtensaelf.em was not updated in the change bcaa7b3eb957 +("ld/"), that replaced boolean wildcard_spec::sorted with enumeration. + +Restore the original behavior of the section sorting code. + +ld/ +2017-08-02 Max Filippov + + * emultempl/xtensaelf.em + (xtensa_wild_group_interleave_callback): Only check for by_name + sorting. + +Signed-off-by: Max Filippov +--- +Backported from: 73d5923e480944e2d66bde8c59f4dff298ec57e3 + + ld/emultempl/xtensaelf.em | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/ld/emultempl/xtensaelf.em b/ld/emultempl/xtensaelf.em +index 1447d526a25b..3827d91b6291 100644 +--- a/ld/emultempl/xtensaelf.em ++++ b/ld/emultempl/xtensaelf.em +@@ -1432,7 +1432,7 @@ xtensa_wild_group_interleave_callback (lang_statement_union_type *statement) + struct wildcard_list *l; + for (l = w->section_list; l != NULL; l = l->next) + { +- if (l->spec.sorted != none) ++ if (l->spec.sorted == by_name) + { + no_reorder = TRUE; + break; +-- +2.1.4 + diff --git a/toolchain/binutils/patches/2.29/xtensa-fix-memory-corruption-by-broken-sysregs.patch b/toolchain/binutils/patches/2.29/xtensa-fix-memory-corruption-by-broken-sysregs.patch deleted file mode 100644 index 30103ee05..000000000 --- a/toolchain/binutils/patches/2.29/xtensa-fix-memory-corruption-by-broken-sysregs.patch +++ /dev/null @@ -1,42 +0,0 @@ -From 3c8788dbb70b40e737d4b8e30cab81406e5c5091 Mon Sep 17 00:00:00 2001 -From: Max Filippov -Date: Wed, 2 Aug 2017 00:36:05 -0700 -Subject: [PATCH] xtensa: fix memory corruption by broken sysregs - -In some xtensa configurations there may be system/user registers in -xtensa-modules with negative index. ISA initialization for such config -may clobber heap and result in program termination. -Don't update lookup table entries for register with negative indices. -They are not directly accessible via RSR/WSR/XSR or RUR/WUR, so this -change should not affect processing of valid assembly/binary code. - -bfd/ -2017-08-02 Max Filippov - - * xtensa-isa.c (xtensa_isa_init): Don't update lookup table - entries for sysregs with negative indices. - -Signed-off-by: Max Filippov ---- -Backported from: d84ed528d4817b0ff854006b65a9f6ec75f0407a - - bfd/xtensa-isa.c | 3 ++- - 1 file changed, 2 insertions(+), 1 deletion(-) - -diff --git a/bfd/xtensa-isa.c b/bfd/xtensa-isa.c -index 8da75bea8109..8c6ee88fdeae 100644 ---- a/bfd/xtensa-isa.c -+++ b/bfd/xtensa-isa.c -@@ -292,7 +292,8 @@ xtensa_isa_init (xtensa_isa_status *errno_p, char **error_msg_p) - xtensa_sysreg_internal *sreg = &isa->sysregs[n]; - is_user = sreg->is_user; - -- isa->sysreg_table[is_user][sreg->number] = n; -+ if (sreg->number >= 0) -+ isa->sysreg_table[is_user][sreg->number] = n; - } - - /* Set up the interface lookup table. */ --- -2.1.4 - diff --git a/toolchain/binutils/patches/2.29/xtensa-ld-restore-old-section-sorting-behavior.patch b/toolchain/binutils/patches/2.29/xtensa-ld-restore-old-section-sorting-behavior.patch deleted file mode 100644 index b4118378d..000000000 --- a/toolchain/binutils/patches/2.29/xtensa-ld-restore-old-section-sorting-behavior.patch +++ /dev/null @@ -1,48 +0,0 @@ -From 3a399127ead1ba3c8b8d0b9e7206fce39311ee72 Mon Sep 17 00:00:00 2001 -From: Max Filippov -Date: Wed, 2 Aug 2017 02:49:56 -0700 -Subject: [PATCH] xtensa: ld: restore old section sorting behavior - -With the recent change 535b785fb0c9 ("Don't compare boolean values -against TRUE or FALSE") the following assertion is observed when -linking with --sort-section,alignment option: - - BFD (GNU Binutils) 2.29 assertion fail elf32-xtensa.c:3965 - -It appears that xtensa linker only supported sorting sections by name, -and the code that checks for the section sorting type in -ld/emultempl/xtensaelf.em was not updated in the change bcaa7b3eb957 -("ld/"), that replaced boolean wildcard_spec::sorted with enumeration. - -Restore the original behavior of the section sorting code. - -ld/ -2017-08-02 Max Filippov - - * emultempl/xtensaelf.em - (xtensa_wild_group_interleave_callback): Only check for by_name - sorting. - -Signed-off-by: Max Filippov ---- -Backported from: 73d5923e480944e2d66bde8c59f4dff298ec57e3 - - ld/emultempl/xtensaelf.em | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/ld/emultempl/xtensaelf.em b/ld/emultempl/xtensaelf.em -index 1447d526a25b..3827d91b6291 100644 ---- a/ld/emultempl/xtensaelf.em -+++ b/ld/emultempl/xtensaelf.em -@@ -1432,7 +1432,7 @@ xtensa_wild_group_interleave_callback (lang_statement_union_type *statement) - struct wildcard_list *l; - for (l = w->section_list; l != NULL; l = l->next) - { -- if (l->spec.sorted != none) -+ if (l->spec.sorted == by_name) - { - no_reorder = TRUE; - break; --- -2.1.4 - diff --git a/toolchain/elf2flt/Makefile b/toolchain/elf2flt/Makefile index fd5fe19a4..244b61f67 100644 --- a/toolchain/elf2flt/Makefile +++ b/toolchain/elf2flt/Makefile @@ -10,7 +10,7 @@ ifeq ($(ADK_TOOLCHAIN_BINUTILS_GIT),y) BINUTILS_VERSION:= git endif ifeq ($(ADK_TOOLCHAIN_BINUTILS_2_29),y) -BINUTILS_VERSION:= 2.29 +BINUTILS_VERSION:= 2.29.1 endif $(WRKBUILD)/.configured: -- cgit v1.2.3