summaryrefslogtreecommitdiffstats
path: root/external/poky/meta/recipes-devtools/elfutils
diff options
context:
space:
mode:
Diffstat (limited to 'external/poky/meta/recipes-devtools/elfutils')
-rw-r--r--external/poky/meta/recipes-devtools/elfutils/elfutils_0.175.bb79
-rw-r--r--external/poky/meta/recipes-devtools/elfutils/elfutils_0.178.bb157
-rw-r--r--external/poky/meta/recipes-devtools/elfutils/files/0001-dso-link-change.patch18
-rw-r--r--external/poky/meta/recipes-devtools/elfutils/files/0001-libasm-may-link-with-libbz2-if-found.patch12
-rw-r--r--external/poky/meta/recipes-devtools/elfutils/files/0001-libelf-elf_end.c-check-data_list.data.d.d_buf-before.patch6
-rw-r--r--external/poky/meta/recipes-devtools/elfutils/files/0001-musl-obstack-fts.patch127
-rw-r--r--external/poky/meta/recipes-devtools/elfutils/files/0001-ppc_initreg.c-Incliude-asm-ptrace.h-for-pt_regs-defi.patch32
-rw-r--r--external/poky/meta/recipes-devtools/elfutils/files/0001-skip-the-test-when-gcc-not-deployed.patch73
-rw-r--r--external/poky/meta/recipes-devtools/elfutils/files/0002-Fix-elf_cvt_gunhash-if-dest-and-src-are-same.patch8
-rw-r--r--external/poky/meta/recipes-devtools/elfutils/files/0002-musl-libs.patch145
-rw-r--r--external/poky/meta/recipes-devtools/elfutils/files/0003-fixheadercheck.patch8
-rw-r--r--external/poky/meta/recipes-devtools/elfutils/files/0003-musl-utils.patch166
-rw-r--r--external/poky/meta/recipes-devtools/elfutils/files/0004-Disable-the-test-to-convert-euc-jp.patch8
-rw-r--r--external/poky/meta/recipes-devtools/elfutils/files/0004-Fix-error-on-musl.patch39
-rw-r--r--external/poky/meta/recipes-devtools/elfutils/files/0006-Fix-build-on-aarch64-musl.patch8
-rw-r--r--external/poky/meta/recipes-devtools/elfutils/files/0007-Fix-control-path-where-we-have-str-as-uninitialized-.patch45
-rw-r--r--external/poky/meta/recipes-devtools/elfutils/files/0008-build-Provide-alternatives-for-glibc-assumptions-hel.patch226
-rw-r--r--external/poky/meta/recipes-devtools/elfutils/files/CVE-2019-7146_p1.patch52
-rw-r--r--external/poky/meta/recipes-devtools/elfutils/files/CVE-2019-7146_p2.patch65
-rw-r--r--external/poky/meta/recipes-devtools/elfutils/files/CVE-2019-7149.patch148
-rw-r--r--external/poky/meta/recipes-devtools/elfutils/files/CVE-2019-7150.patch51
-rw-r--r--external/poky/meta/recipes-devtools/elfutils/files/CVE-2019-7664.patch65
-rw-r--r--external/poky/meta/recipes-devtools/elfutils/files/CVE-2019-7665.patch154
-rw-r--r--external/poky/meta/recipes-devtools/elfutils/files/debian/0001-Ignore-differences-between-mips-machine-identifiers.patch1
-rw-r--r--external/poky/meta/recipes-devtools/elfutils/files/debian/0001-fix-compile-failure-with-debian-patches.patch48
-rw-r--r--external/poky/meta/recipes-devtools/elfutils/files/debian/0002-Add-support-for-mips64-abis-in-mips_retval.c.patch1
-rw-r--r--external/poky/meta/recipes-devtools/elfutils/files/debian/0003-Add-mips-n64-relocation-format-hack.patch1
-rw-r--r--external/poky/meta/recipes-devtools/elfutils/files/debian/arm_backend.diff341
-rw-r--r--external/poky/meta/recipes-devtools/elfutils/files/debian/disable_werror.patch8
-rw-r--r--external/poky/meta/recipes-devtools/elfutils/files/debian/hppa_backend.diff156
-rw-r--r--external/poky/meta/recipes-devtools/elfutils/files/debian/hurd_path.patch1
-rw-r--r--external/poky/meta/recipes-devtools/elfutils/files/debian/kfreebsd_path.patch1
-rw-r--r--external/poky/meta/recipes-devtools/elfutils/files/debian/mips_backend.diff151
-rw-r--r--external/poky/meta/recipes-devtools/elfutils/files/debian/mips_cfi.patch129
-rw-r--r--external/poky/meta/recipes-devtools/elfutils/files/debian/mips_readelf_w.patch30
-rw-r--r--external/poky/meta/recipes-devtools/elfutils/files/debian/testsuite-ignore-elflint.diff52
-rw-r--r--external/poky/meta/recipes-devtools/elfutils/files/ptest.patch76
-rw-r--r--external/poky/meta/recipes-devtools/elfutils/files/run-ptest6
38 files changed, 1469 insertions, 1225 deletions
diff --git a/external/poky/meta/recipes-devtools/elfutils/elfutils_0.175.bb b/external/poky/meta/recipes-devtools/elfutils/elfutils_0.175.bb
deleted file mode 100644
index 862a9b6c..00000000
--- a/external/poky/meta/recipes-devtools/elfutils/elfutils_0.175.bb
+++ /dev/null
@@ -1,79 +0,0 @@
-SUMMARY = "Utilities and libraries for handling compiled object files"
-HOMEPAGE = "https://sourceware.org/elfutils"
-SECTION = "base"
-LICENSE = "(GPLv3 & Elfutils-Exception)"
-LIC_FILES_CHKSUM = "file://COPYING;md5=d32239bcb673463ab874e80d47fae504"
-DEPENDS = "libtool bzip2 zlib virtual/libintl"
-DEPENDS_append_libc-musl = " argp-standalone fts "
-# The Debian patches below are from:
-# http://ftp.de.debian.org/debian/pool/main/e/elfutils/elfutils_0.175-1.debian.tar.xz
-SRC_URI = "https://sourceware.org/elfutils/ftp/${PV}/${BP}.tar.bz2 \
- file://0001-dso-link-change.patch \
- file://0002-Fix-elf_cvt_gunhash-if-dest-and-src-are-same.patch \
- file://0003-fixheadercheck.patch \
- file://0004-Disable-the-test-to-convert-euc-jp.patch \
- file://0006-Fix-build-on-aarch64-musl.patch \
- file://0007-Fix-control-path-where-we-have-str-as-uninitialized-.patch \
- file://0001-libasm-may-link-with-libbz2-if-found.patch \
- file://0001-libelf-elf_end.c-check-data_list.data.d.d_buf-before.patch \
- file://debian/hppa_backend.diff \
- file://debian/arm_backend.diff \
- file://debian/mips_backend.diff \
- file://debian/mips_readelf_w.patch \
- file://debian/kfreebsd_path.patch \
- file://debian/0001-Ignore-differences-between-mips-machine-identifiers.patch \
- file://debian/0002-Add-support-for-mips64-abis-in-mips_retval.c.patch \
- file://debian/0003-Add-mips-n64-relocation-format-hack.patch \
- file://debian/hurd_path.patch \
- file://debian/ignore_strmerge.diff \
- file://debian/disable_werror.patch \
- file://CVE-2019-7149.patch \
- file://CVE-2019-7150.patch \
- file://CVE-2019-7146_p1.patch \
- file://CVE-2019-7146_p2.patch \
- file://CVE-2019-7664.patch \
- file://CVE-2019-7665.patch \
- "
-SRC_URI_append_libc-musl = " file://0008-build-Provide-alternatives-for-glibc-assumptions-hel.patch"
-
-SRC_URI[md5sum] = "9a02b0382b78cc2d515fb950275d4c02"
-SRC_URI[sha256sum] = "f7ef925541ee32c6d15ae5cb27da5f119e01a5ccdbe9fe57bf836730d7b7a65b"
-
-inherit autotools gettext
-
-EXTRA_OECONF = "--program-prefix=eu- --without-lzma"
-EXTRA_OECONF_append_class-native = " --without-bzlib"
-
-do_install_append() {
- if [ "${TARGET_ARCH}" != "x86_64" ] && [ -z `echo "${TARGET_ARCH}"|grep 'i.86'` ];then
- rm -f ${D}${bindir}/eu-objdump
- fi
-}
-
-EXTRA_OEMAKE_class-native = ""
-EXTRA_OEMAKE_class-nativesdk = ""
-
-ALLOW_EMPTY_${PN}_libc-musl = "1"
-
-BBCLASSEXTEND = "native nativesdk"
-
-# Package utilities separately
-PACKAGES =+ "${PN}-binutils libelf libasm libdw"
-FILES_${PN}-binutils = "\
- ${bindir}/eu-addr2line \
- ${bindir}/eu-ld \
- ${bindir}/eu-nm \
- ${bindir}/eu-readelf \
- ${bindir}/eu-size \
- ${bindir}/eu-strip"
-
-FILES_libelf = "${libdir}/libelf-${PV}.so ${libdir}/libelf.so.*"
-FILES_libasm = "${libdir}/libasm-${PV}.so ${libdir}/libasm.so.*"
-FILES_libdw = "${libdir}/libdw-${PV}.so ${libdir}/libdw.so.* ${libdir}/elfutils/lib*"
-# Some packages have the version preceeding the .so instead properly
-# versioned .so.<version>, so we need to reorder and repackage.
-#FILES_${PN} += "${libdir}/*-${PV}.so ${base_libdir}/*-${PV}.so"
-#FILES_SOLIBSDEV = "${libdir}/libasm.so ${libdir}/libdw.so ${libdir}/libelf.so"
-
-# The package contains symlinks that trip up insane
-INSANE_SKIP_${MLPREFIX}libdw = "dev-so"
diff --git a/external/poky/meta/recipes-devtools/elfutils/elfutils_0.178.bb b/external/poky/meta/recipes-devtools/elfutils/elfutils_0.178.bb
new file mode 100644
index 00000000..c500ae3c
--- /dev/null
+++ b/external/poky/meta/recipes-devtools/elfutils/elfutils_0.178.bb
@@ -0,0 +1,157 @@
+SUMMARY = "Utilities and libraries for handling compiled object files"
+HOMEPAGE = "https://sourceware.org/elfutils"
+SECTION = "base"
+LICENSE = "GPLv2 & LGPLv3+ & GPLv3+"
+LIC_FILES_CHKSUM = "file://COPYING;md5=d32239bcb673463ab874e80d47fae504"
+DEPENDS = "zlib virtual/libintl"
+DEPENDS_append_libc-musl = " argp-standalone fts musl-obstack "
+# The Debian patches below are from:
+# http://ftp.de.debian.org/debian/pool/main/e/elfutils/elfutils_0.176-1.debian.tar.xz
+SRC_URI = "https://sourceware.org/elfutils/ftp/${PV}/${BP}.tar.bz2 \
+ file://0001-dso-link-change.patch \
+ file://0002-Fix-elf_cvt_gunhash-if-dest-and-src-are-same.patch \
+ file://0003-fixheadercheck.patch \
+ file://0004-Disable-the-test-to-convert-euc-jp.patch \
+ file://0006-Fix-build-on-aarch64-musl.patch \
+ file://0001-libasm-may-link-with-libbz2-if-found.patch \
+ file://0001-libelf-elf_end.c-check-data_list.data.d.d_buf-before.patch \
+ file://debian/hppa_backend.diff \
+ file://debian/arm_backend.diff \
+ file://debian/mips_backend.diff \
+ file://debian/mips_readelf_w.patch \
+ file://debian/kfreebsd_path.patch \
+ file://debian/0001-Ignore-differences-between-mips-machine-identifiers.patch \
+ file://debian/0002-Add-support-for-mips64-abis-in-mips_retval.c.patch \
+ file://debian/0003-Add-mips-n64-relocation-format-hack.patch \
+ file://debian/hurd_path.patch \
+ file://debian/ignore_strmerge.diff \
+ file://debian/disable_werror.patch \
+ file://debian/testsuite-ignore-elflint.diff \
+ file://debian/mips_cfi.patch \
+ file://debian/0001-fix-compile-failure-with-debian-patches.patch \
+ file://0001-skip-the-test-when-gcc-not-deployed.patch \
+ file://0001-ppc_initreg.c-Incliude-asm-ptrace.h-for-pt_regs-defi.patch \
+ file://run-ptest \
+ file://ptest.patch \
+ "
+SRC_URI_append_libc-musl = " \
+ file://0001-musl-obstack-fts.patch \
+ file://0002-musl-libs.patch \
+ file://0003-musl-utils.patch \
+ file://0004-Fix-error-on-musl.patch \
+ "
+SRC_URI[md5sum] = "5480d0b7174446aba13a6adde107287f"
+SRC_URI[sha256sum] = "31e7a00e96d4e9c4bda452e1f2cdac4daf8abd24f5e154dee232131899f3a0f2"
+
+inherit autotools gettext ptest pkgconfig
+
+EXTRA_OECONF = "--program-prefix=eu- --disable-debuginfod"
+
+DEPENDS_BZIP2 = "bzip2-replacement-native"
+DEPENDS_BZIP2_class-target = "bzip2"
+
+PACKAGECONFIG ??= ""
+PACKAGECONFIG[bzip2] = "--with-bzlib,--without-bzlib,${DEPENDS_BZIP2}"
+PACKAGECONFIG[xz] = "--with-lzma,--without-lzma,xz"
+
+RDEPENDS_${PN}-ptest += "libasm libelf bash make coreutils ${PN}-binutils"
+
+EXTRA_OECONF_append_class-target = " --disable-tests-rpath"
+
+RDEPENDS_${PN}-ptest_append_libc-glibc = " glibc-utils"
+
+do_compile_ptest() {
+ cd ${B}/tests
+ oe_runmake buildtest-TESTS oecheck
+}
+
+do_install_ptest() {
+ if [ ${PTEST_ENABLED} = "1" ]; then
+ # copy the files which needed by the cases
+ TEST_FILES="strip strip.o addr2line elfcmp objdump readelf size.o nm.o nm elflint elfcompress elfclassify stack unstrip"
+ install -d -m 755 ${D}${PTEST_PATH}/src
+ install -d -m 755 ${D}${PTEST_PATH}/libelf
+ install -d -m 755 ${D}${PTEST_PATH}/libdw
+ install -d -m 755 ${D}${PTEST_PATH}/libasm
+ for test_file in ${TEST_FILES}; do
+ if [ -f ${B}/src/${test_file} ]; then
+ cp -r ${B}/src/${test_file} ${D}${PTEST_PATH}/src
+ fi
+ done
+ cp ${D}${libdir}/libelf-${PV}.so ${D}${PTEST_PATH}/libelf/libelf.so
+ cp ${D}${libdir}/libdw-${PV}.so ${D}${PTEST_PATH}/libdw/libdw.so
+ cp ${D}${libdir}/libasm-${PV}.so ${D}${PTEST_PATH}/libasm/libasm.so
+ cp -r ${S}/tests/ ${D}${PTEST_PATH}
+ cp -r ${B}/tests/* ${D}${PTEST_PATH}/tests
+ cp -r ${B}/config.h ${D}${PTEST_PATH}
+ cp -r ${B}/backends ${D}${PTEST_PATH}
+ sed -i '/^Makefile:/c Makefile:' ${D}${PTEST_PATH}/tests/Makefile
+ find ${D}${PTEST_PATH} -type f -name *.[hoc] | xargs -i rm {}
+ fi
+}
+
+EXTRA_OEMAKE_class-native = ""
+EXTRA_OEMAKE_class-nativesdk = ""
+
+BBCLASSEXTEND = "native nativesdk"
+
+# Package utilities separately
+PACKAGES =+ "${PN}-binutils libelf libasm libdw"
+
+# shared libraries are licensed GPLv2 or GPLv3+, binaries GPLv3+
+# according to NEWS file:
+# "The license is now GPLv2/LGPLv3+ for the libraries and GPLv3+ for stand-alone
+# programs. There is now also a formal CONTRIBUTING document describing how to
+# submit patches."
+LICENSE_${PN}-binutils = "GPLv3+"
+LICENSE_${PN} = "GPLv3+"
+LICENSE_libelf = "GPLv2 | LGPLv3+"
+LICENSE_libasm = "GPLv2 | LGPLv3+"
+LICENSE_libdw = "GPLv2 | LGPLv3+"
+
+FILES_${PN}-binutils = "\
+ ${bindir}/eu-addr2line \
+ ${bindir}/eu-ld \
+ ${bindir}/eu-nm \
+ ${bindir}/eu-readelf \
+ ${bindir}/eu-size \
+ ${bindir}/eu-strip"
+
+FILES_libelf = "${libdir}/libelf-${PV}.so ${libdir}/libelf.so.*"
+FILES_libasm = "${libdir}/libasm-${PV}.so ${libdir}/libasm.so.*"
+FILES_libdw = "${libdir}/libdw-${PV}.so ${libdir}/libdw.so.* ${libdir}/elfutils/lib*"
+# Some packages have the version preceeding the .so instead properly
+# versioned .so.<version>, so we need to reorder and repackage.
+#FILES_${PN} += "${libdir}/*-${PV}.so ${base_libdir}/*-${PV}.so"
+#FILES_SOLIBSDEV = "${libdir}/libasm.so ${libdir}/libdw.so ${libdir}/libelf.so"
+
+# The package contains symlinks that trip up insane
+INSANE_SKIP_${MLPREFIX}libdw = "dev-so"
+
+# avoid stripping some generated binaries otherwise some of the tests such as test-nlist,
+# run-strip-reloc.sh, run-strip-strmerge.sh and so on will fail
+INHIBIT_PACKAGE_STRIP_FILES = "\
+ ${PKGD}${PTEST_PATH}/tests/test-nlist \
+ ${PKGD}${PTEST_PATH}/tests/elfstrmerge \
+ ${PKGD}${PTEST_PATH}/tests/backtrace-child \
+ ${PKGD}${PTEST_PATH}/tests/backtrace-data \
+ ${PKGD}${PTEST_PATH}/tests/backtrace-dwarf \
+ ${PKGD}${PTEST_PATH}/tests/deleted \
+ ${PKGD}${PTEST_PATH}/src/strip \
+ ${PKGD}${PTEST_PATH}/src/addr2line \
+ ${PKGD}${PTEST_PATH}/src/elfcmp \
+ ${PKGD}${PTEST_PATH}/src/objdump \
+ ${PKGD}${PTEST_PATH}/src/readelf \
+ ${PKGD}${PTEST_PATH}/src/nm \
+ ${PKGD}${PTEST_PATH}/src/elflint \
+ ${PKGD}${PTEST_PATH}/src/elfclassify \
+ ${PKGD}${PTEST_PATH}/src/stack \
+ ${PKGD}${PTEST_PATH}/src/unstrip \
+ ${PKGD}${PTEST_PATH}/libelf/libelf.so \
+ ${PKGD}${PTEST_PATH}/libdw/libdw.so \
+ ${PKGD}${PTEST_PATH}/libasm/libasm.so \
+ ${PKGD}${PTEST_PATH}/backends/libebl_i386.so \
+ ${PKGD}${PTEST_PATH}/backends/libebl_x86_64.so \
+"
+
+PRIVATE_LIBS_${PN}-ptest = "libdw.so.1 libelf.so.1 libasm.so.1"
diff --git a/external/poky/meta/recipes-devtools/elfutils/files/0001-dso-link-change.patch b/external/poky/meta/recipes-devtools/elfutils/files/0001-dso-link-change.patch
index 4c62dc51..62031073 100644
--- a/external/poky/meta/recipes-devtools/elfutils/files/0001-dso-link-change.patch
+++ b/external/poky/meta/recipes-devtools/elfutils/files/0001-dso-link-change.patch
@@ -1,7 +1,7 @@
-From c9c6d2414651dbf163dc4963c3c3d6f5cacef898 Mon Sep 17 00:00:00 2001
+From ec9a7742734aae5417c0ebbffce66ac353e6cae7 Mon Sep 17 00:00:00 2001
From: Hongxu Jia <hongxu.jia@windriver.com>
Date: Tue, 15 Aug 2017 17:10:57 +0800
-Subject: [PATCH 1/7] dso link change
+Subject: [PATCH] dso link change
Upstream-Status: Pending
@@ -16,16 +16,17 @@ more details.
Rebase to 0.170
Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
+
---
src/Makefile.am | 2 +-
tests/Makefile.am | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/Makefile.am b/src/Makefile.am
-index 2b1c0dc..9305b84 100644
+index e462e7d..ea1215b 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
-@@ -44,7 +44,7 @@ libdw = ../libdw/libdw.a -lz $(zip_LIBS) $(libelf) $(libebl) -ldl
+@@ -45,7 +45,7 @@ libdw = ../libdw/libdw.a -lz $(zip_LIBS) $(libelf) -ldl -lpthread
libelf = ../libelf/libelf.a -lz
else
libasm = ../libasm/libasm.so
@@ -33,12 +34,12 @@ index 2b1c0dc..9305b84 100644
+libdw = ../libdw/libdw.so $(zip_LIBS) $(libelf) $(libebl) -ldl
libelf = ../libelf/libelf.so
endif
- libebl = ../libebl/libebl.a
+ libebl = ../libebl/libebl.a ../backends/libebl_backends.a ../libcpu/libcpu.a
diff --git a/tests/Makefile.am b/tests/Makefile.am
-index b45ecdc..dd256fb 100644
+index eab4ae6..f59a01f 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
-@@ -436,7 +436,7 @@ libdw = ../libdw/libdw.a -lz $(zip_LIBS) $(libelf) $(libebl) -ldl
+@@ -516,7 +516,7 @@ libdw = ../libdw/libdw.a -lz $(zip_LIBS) $(libelf) $(libebl) -ldl -lpthread
libelf = ../libelf/libelf.a -lz
libasm = ../libasm/libasm.a
else
@@ -47,6 +48,3 @@ index b45ecdc..dd256fb 100644
libelf = ../libelf/libelf.so
libasm = ../libasm/libasm.so
endif
---
-2.7.4
-
diff --git a/external/poky/meta/recipes-devtools/elfutils/files/0001-libasm-may-link-with-libbz2-if-found.patch b/external/poky/meta/recipes-devtools/elfutils/files/0001-libasm-may-link-with-libbz2-if-found.patch
index c342053a..73ead6d4 100644
--- a/external/poky/meta/recipes-devtools/elfutils/files/0001-libasm-may-link-with-libbz2-if-found.patch
+++ b/external/poky/meta/recipes-devtools/elfutils/files/0001-libasm-may-link-with-libbz2-if-found.patch
@@ -1,4 +1,4 @@
-From 74629016e76343a4bf39915c9192b6bf26a57c2d Mon Sep 17 00:00:00 2001
+From 8e5fff8b1d819e0870fb22b27950bb5f10c7a272 Mon Sep 17 00:00:00 2001
From: Khem Raj <raj.khem@gmail.com>
Date: Wed, 4 Oct 2017 22:30:46 -0700
Subject: [PATCH] libasm may link with libbz2 if found
@@ -11,21 +11,22 @@ where indirect libraries may be not found by linker
Upstream-Status: Pending
Signed-off-by: Khem Raj <raj.khem@gmail.com>
+
---
src/Makefile.am | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/Makefile.am b/src/Makefile.am
-index 9305b84..9b7e853 100644
+index ea1215b..13d9bda 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
-@@ -39,11 +39,11 @@ EXTRA_DIST += make-debug-archive.in
+@@ -40,11 +40,11 @@ EXTRA_DIST += make-debug-archive.in
CLEANFILES += make-debug-archive
if BUILD_STATIC
-libasm = ../libasm/libasm.a
+libasm = ../libasm/libasm.a $(zip_LIBS)
- libdw = ../libdw/libdw.a -lz $(zip_LIBS) $(libelf) $(libebl) -ldl
+ libdw = ../libdw/libdw.a -lz $(zip_LIBS) $(libelf) -ldl -lpthread
libelf = ../libelf/libelf.a -lz
else
-libasm = ../libasm/libasm.so
@@ -33,6 +34,3 @@ index 9305b84..9b7e853 100644
libdw = ../libdw/libdw.so $(zip_LIBS) $(libelf) $(libebl) -ldl
libelf = ../libelf/libelf.so
endif
---
-2.7.4
-
diff --git a/external/poky/meta/recipes-devtools/elfutils/files/0001-libelf-elf_end.c-check-data_list.data.d.d_buf-before.patch b/external/poky/meta/recipes-devtools/elfutils/files/0001-libelf-elf_end.c-check-data_list.data.d.d_buf-before.patch
index 1bdb5116..b26ed99f 100644
--- a/external/poky/meta/recipes-devtools/elfutils/files/0001-libelf-elf_end.c-check-data_list.data.d.d_buf-before.patch
+++ b/external/poky/meta/recipes-devtools/elfutils/files/0001-libelf-elf_end.c-check-data_list.data.d.d_buf-before.patch
@@ -1,4 +1,4 @@
-From 3393a2e544818f0bd1887c13f28a76ad60c2df98 Mon Sep 17 00:00:00 2001
+From e571cbd0c20085ec71969971f19280b5de95cfb7 Mon Sep 17 00:00:00 2001
From: Robert Yang <liezhi.yang@windriver.com>
Date: Thu, 16 Aug 2018 09:58:26 +0800
Subject: [PATCH] libelf/elf_end.c: check data_list.data.d.d_buf before free it
@@ -14,6 +14,7 @@ The segmentation fault happens when prelink call elf_end().
Upstream-Status: Submitted [https://sourceware.org/ml/elfutils-devel/2018-q3/msg00085.html]
Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
+
---
libelf/elf_end.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
@@ -41,6 +42,3 @@ index 160f0b8..5280a70 100644
free (scn->rawdata_base);
/* Free the list of data buffers for the section.
---
-2.7.4
-
diff --git a/external/poky/meta/recipes-devtools/elfutils/files/0001-musl-obstack-fts.patch b/external/poky/meta/recipes-devtools/elfutils/files/0001-musl-obstack-fts.patch
new file mode 100644
index 00000000..f751a2ec
--- /dev/null
+++ b/external/poky/meta/recipes-devtools/elfutils/files/0001-musl-obstack-fts.patch
@@ -0,0 +1,127 @@
+From 8ccf3d92b8766b53f203df7e01b489604ef851f3 Mon Sep 17 00:00:00 2001
+From: Hongxu Jia <hongxu.jia@windriver.com>
+Date: Fri, 23 Aug 2019 10:17:25 +0800
+Subject: [PATCH 1/4] musl-obstack-fts
+
+Look for libfts and libobstack during configure, these
+libraries are external to libc when using musl, whereas
+on glibc these libraries are provided in libc itself.
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+Upstream-Status: Inappropriate [workaround for musl]
+
+Rebase to 0.177
+Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
+
+---
+ configure.ac | 54 +++++++++++++++++++++++++++++++++++++++++++++++
+ libdw/Makefile.am | 2 +-
+ src/Makefile.am | 6 +++---
+ 3 files changed, 58 insertions(+), 4 deletions(-)
+
+diff --git a/configure.ac b/configure.ac
+index cad7b2b..6d4229b 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -529,6 +529,60 @@ else
+ fi
+ AC_SUBST([argp_LDADD])
+
++dnl Check if we have fts available from our libc
++AC_LINK_IFELSE(
++ [AC_LANG_PROGRAM(
++ [#if !defined(__x86_64__)
++ #undef _FILE_OFFSET_BITS
++ #define _FILE_OFFSET_BITS 32
++ #endif
++ #include <fts.h>],
++ [FTS* fts = 0; return fts_close(fts); return 0;]
++ )],
++ [libc_has_fts="true"],
++ [libc_has_fts="false"]
++)
++
++dnl If our libc doesn't provide fts, then test for libfts
++if test "$libc_has_fts" = "false" ; then
++ AC_MSG_WARN("libc does not have fts")
++ AC_CHECK_LIB([fts], [fts_close], [have_fts="true"], [have_fts="false"])
++
++ if test "$have_fts" = "false"; then
++ AC_MSG_ERROR("no libfts found")
++ else
++ fts_LDADD="-lfts"
++ fi
++else
++ fts_LDADD=""
++fi
++AC_SUBST([fts_LDADD])
++
++dnl Check if we have obstack available from our libc
++AC_LINK_IFELSE(
++ [AC_LANG_PROGRAM(
++ [#include <obstack.h>],
++ [_obstack_begin(0, 0, 0, NULL, NULL); return 0;]
++ )],
++ [libc_has_obstack="true"],
++ [libc_has_obstack="false"]
++)
++
++dnl If our libc doesn't provide obstack, then test for libobstack
++if test "$libc_has_obstack" = "false" ; then
++ AC_MSG_WARN("libc does not have obstack")
++ AC_CHECK_LIB([obstack], [_obstack_begin], [have_obstack="true"], [have_obstack="false"])
++
++ if test "$have_obstack" = "false"; then
++ AC_MSG_ERROR("no libobstack found")
++ else
++ obstack_LDADD="-lobstack"
++ fi
++else
++ obstack_LDADD=""
++fi
++AC_SUBST([obstack_LDADD])
++
+ dnl The directories with content.
+
+ dnl Documentation.
+diff --git a/libdw/Makefile.am b/libdw/Makefile.am
+index 33b5838..ff92e02 100644
+--- a/libdw/Makefile.am
++++ b/libdw/Makefile.am
+@@ -109,7 +109,7 @@ libdw_so_LIBS = ../libebl/libebl_pic.a ../backends/libebl_backends_pic.a \
+ ../libcpu/libcpu_pic.a libdw_pic.a ../libdwelf/libdwelf_pic.a \
+ ../libdwfl/libdwfl_pic.a
+ libdw_so_DEPS = ../lib/libeu.a ../libelf/libelf.so
+-libdw_so_LDLIBS = $(libdw_so_DEPS) -ldl -lz $(argp_LDADD) $(zip_LIBS) -pthread
++libdw_so_LDLIBS = $(libdw_so_DEPS) -ldl -lz $(argp_LDADD) $(fts_LDADD) $(zip_LIBS) -pthread
+ libdw_so_SOURCES =
+ libdw.so$(EXEEXT): $(srcdir)/libdw.map $(libdw_so_LIBS) $(libdw_so_DEPS)
+ $(AM_V_CCLD)$(LINK) $(dso_LDFLAGS) -o $@ \
+diff --git a/src/Makefile.am b/src/Makefile.am
+index 13d9bda..d5a4f7d 100644
+--- a/src/Makefile.am
++++ b/src/Makefile.am
+@@ -69,7 +69,7 @@ ar_no_Wstack_usage = yes
+ unstrip_no_Wstack_usage = yes
+
+ readelf_LDADD = $(libdw) $(libebl) $(libelf) $(libeu) $(argp_LDADD)
+-nm_LDADD = $(libdw) $(libebl) $(libelf) $(libeu) $(argp_LDADD) \
++nm_LDADD = $(libdw) $(libebl) $(libelf) $(libeu) $(argp_LDADD) $(obstack_LDADD) \
+ $(demanglelib)
+ size_LDADD = $(libelf) $(libeu) $(argp_LDADD)
+ strip_LDADD = $(libebl) $(libelf) $(libdw) $(libeu) $(argp_LDADD)
+@@ -78,9 +78,9 @@ findtextrel_LDADD = $(libdw) $(libelf) $(libeu) $(argp_LDADD)
+ addr2line_LDADD = $(libdw) $(libelf) $(libeu) $(argp_LDADD) $(demanglelib)
+ elfcmp_LDADD = $(libebl) $(libdw) $(libelf) $(libeu) $(argp_LDADD)
+ objdump_LDADD = $(libasm) $(libebl) $(libdw) $(libelf) $(libeu) $(argp_LDADD)
+-ranlib_LDADD = libar.a $(libelf) $(libeu) $(argp_LDADD)
++ranlib_LDADD = libar.a $(libelf) $(libeu) $(argp_LDADD) $(obstack_LDADD)
+ strings_LDADD = $(libelf) $(libeu) $(argp_LDADD)
+-ar_LDADD = libar.a $(libelf) $(libeu) $(argp_LDADD)
++ar_LDADD = libar.a $(libelf) $(libeu) $(argp_LDADD) $(obstack_LDADD)
+ unstrip_LDADD = $(libebl) $(libelf) $(libdw) $(libeu) $(argp_LDADD)
+ stack_LDADD = $(libebl) $(libelf) $(libdw) $(libeu) $(argp_LDADD) $(demanglelib)
+ elfcompress_LDADD = $(libebl) $(libelf) $(libdw) $(libeu) $(argp_LDADD)
+--
+2.17.1
+
diff --git a/external/poky/meta/recipes-devtools/elfutils/files/0001-ppc_initreg.c-Incliude-asm-ptrace.h-for-pt_regs-defi.patch b/external/poky/meta/recipes-devtools/elfutils/files/0001-ppc_initreg.c-Incliude-asm-ptrace.h-for-pt_regs-defi.patch
new file mode 100644
index 00000000..3303333c
--- /dev/null
+++ b/external/poky/meta/recipes-devtools/elfutils/files/0001-ppc_initreg.c-Incliude-asm-ptrace.h-for-pt_regs-defi.patch
@@ -0,0 +1,32 @@
+From 2e2232d0935bf8ef6e66ebffba3be68a73b5b3e5 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Sun, 8 Sep 2019 15:57:59 -0700
+Subject: [PATCH] ppc_initreg.c: Incliude asm/ptrace.h for pt_regs definition
+
+Fixes
+| ../../elfutils-0.176/backends/ppc_initreg.c:79:22: error: field 'r' has incomplete type
+| struct pt_regs r;
+| ^
+
+Upstream-Status: Pending
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ backends/ppc_initreg.c | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/backends/ppc_initreg.c b/backends/ppc_initreg.c
+index 0e0d359..e5cca7e 100644
+--- a/backends/ppc_initreg.c
++++ b/backends/ppc_initreg.c
+@@ -33,6 +33,7 @@
+ #include <stdlib.h>
+ #if defined(__powerpc__) && defined(__linux__)
+ # include <sys/ptrace.h>
++# include <asm/ptrace.h>
+ # include <sys/user.h>
+ #endif
+
+--
+2.23.0
+
diff --git a/external/poky/meta/recipes-devtools/elfutils/files/0001-skip-the-test-when-gcc-not-deployed.patch b/external/poky/meta/recipes-devtools/elfutils/files/0001-skip-the-test-when-gcc-not-deployed.patch
new file mode 100644
index 00000000..de8c05f1
--- /dev/null
+++ b/external/poky/meta/recipes-devtools/elfutils/files/0001-skip-the-test-when-gcc-not-deployed.patch
@@ -0,0 +1,73 @@
+From e82a055f85e398cb03a4eaf5faf351a3a1f19344 Mon Sep 17 00:00:00 2001
+From: Mingli Yu <Mingli.Yu@windriver.com>
+Date: Tue, 21 May 2019 15:20:34 +0800
+Subject: [PATCH v2] skip the test when gcc not deployed
+
+Skip the tests which depend on gcc when
+gcc not deployed.
+
+Upstream-Status: Submitted[https://sourceware.org/ml/elfutils-devel/2019-q2/msg00091.html]
+
+Signed-off-by: Mingli Yu <Mingli.Yu@windriver.com>
+---
+ tests/run-disasm-x86-64.sh | 2 ++
+ tests/run-disasm-x86.sh | 2 ++
+ tests/run-strip-g.sh | 2 ++
+ tests/run-strip-nothing.sh | 2 ++
+ 4 files changed, 8 insertions(+)
+
+diff --git a/tests/run-disasm-x86-64.sh b/tests/run-disasm-x86-64.sh
+index a6be62b..c3ef238 100755
+--- a/tests/run-disasm-x86-64.sh
++++ b/tests/run-disasm-x86-64.sh
+@@ -22,6 +22,8 @@ case "`uname -m`" in
+ x86_64)
+ tempfiles testfile45.o
+ testfiles testfile45.S testfile45.expect
++ # skip the case if no gcc deployed
++ which gcc || exit 77
+ gcc -m64 -c -o testfile45.o testfile45.S
+ testrun_compare ${abs_top_builddir}/src/objdump -d testfile45.o < testfile45.expect
+ ;;
+diff --git a/tests/run-disasm-x86.sh b/tests/run-disasm-x86.sh
+index 28a3df7..544fc28 100755
+--- a/tests/run-disasm-x86.sh
++++ b/tests/run-disasm-x86.sh
+@@ -22,6 +22,8 @@ case "`uname -m`" in
+ x86_64 | i?86 )
+ tempfiles testfile44.o
+ testfiles testfile44.S testfile44.expect
++ # skip the case if no gcc deployed
++ which gcc || exit 77
+ gcc -m32 -c -o testfile44.o testfile44.S
+ testrun_compare ${abs_top_builddir}/src/objdump -d testfile44.o < testfile44.expect
+ ;;
+diff --git a/tests/run-strip-g.sh b/tests/run-strip-g.sh
+index 1303819..a943dec 100755
+--- a/tests/run-strip-g.sh
++++ b/tests/run-strip-g.sh
+@@ -24,6 +24,8 @@
+
+ tempfiles a.out strip.out debug.out readelf.out
+
++# skip the test if gcc deployed
++which gcc || exit 77
+ echo Create debug a.out.
+ echo "int main() { return 1; }" | gcc -g -xc -
+
+diff --git a/tests/run-strip-nothing.sh b/tests/run-strip-nothing.sh
+index 914fdfb..d03f734 100755
+--- a/tests/run-strip-nothing.sh
++++ b/tests/run-strip-nothing.sh
+@@ -22,6 +22,8 @@
+
+ tempfiles a.out strip.out debug.out
+
++# skip the case if no gcc deployed
++which gcc || exit 77
+ # Create no-debug a.out.
+ echo "int main() { return 1; }" | gcc -s -xc -
+
+--
+2.7.4
+
diff --git a/external/poky/meta/recipes-devtools/elfutils/files/0002-Fix-elf_cvt_gunhash-if-dest-and-src-are-same.patch b/external/poky/meta/recipes-devtools/elfutils/files/0002-Fix-elf_cvt_gunhash-if-dest-and-src-are-same.patch
index 86d26bdf..96c2565e 100644
--- a/external/poky/meta/recipes-devtools/elfutils/files/0002-Fix-elf_cvt_gunhash-if-dest-and-src-are-same.patch
+++ b/external/poky/meta/recipes-devtools/elfutils/files/0002-Fix-elf_cvt_gunhash-if-dest-and-src-are-same.patch
@@ -1,7 +1,7 @@
-From 9fd4bb05d3f2b7eaf9fe441bee26d3b1878d7cc7 Mon Sep 17 00:00:00 2001
+From f8e4118b60a9b54950437006a82b4047f38f5347 Mon Sep 17 00:00:00 2001
From: Hongxu Jia <hongxu.jia@windriver.com>
Date: Tue, 15 Aug 2017 17:13:59 +0800
-Subject: [PATCH 2/7] Fix elf_cvt_gunhash if dest and src are same.
+Subject: [PATCH] Fix elf_cvt_gunhash if dest and src are same.
Upstream-Status: Pending
@@ -12,6 +12,7 @@ Signed-off-by: Baoshan Pang <BaoShan.Pang@windriver.com>
Rebase to 0.170
Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
+
---
libelf/gnuhash_xlate.h | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
@@ -37,6 +38,3 @@ index 6faf113..04d9ca1 100644
/* Now the 64 bit words. */
Elf64_Xword *dest64 = (Elf64_Xword *) &dest32[4];
---
-2.7.4
-
diff --git a/external/poky/meta/recipes-devtools/elfutils/files/0002-musl-libs.patch b/external/poky/meta/recipes-devtools/elfutils/files/0002-musl-libs.patch
new file mode 100644
index 00000000..cf146838
--- /dev/null
+++ b/external/poky/meta/recipes-devtools/elfutils/files/0002-musl-libs.patch
@@ -0,0 +1,145 @@
+From ea908c7009de5a208383abf4bec4c6b3d9519ca3 Mon Sep 17 00:00:00 2001
+From: Hongxu Jia <hongxu.jia@windriver.com>
+Date: Fri, 23 Aug 2019 10:18:47 +0800
+Subject: [PATCH 2/4] musl-libs
+
+Collection of fixes needed to compile libelf and other libraries
+provided by elfutils for musl targets
+
+error is glibc specific API, so this patch will mostly not accepted
+upstream given that elfutils has been closely tied to glibc
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+Upstream-Status: Inappropriate [workaround for musl]
+
+Rebase to 0.177
+Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
+
+---
+ lib/error.h | 27 +++++++++++++++++++++++++++
+ lib/fixedsizehash.h | 1 -
+ lib/libeu.h | 1 +
+ libdwfl/dwfl_error.c | 9 +++++++++
+ libdwfl/linux-kernel-modules.c | 1 +
+ libelf/elf.h | 9 ++++++---
+ 6 files changed, 44 insertions(+), 4 deletions(-)
+ create mode 100644 lib/error.h
+
+diff --git a/lib/error.h b/lib/error.h
+new file mode 100644
+index 0000000..ef06827
+--- /dev/null
++++ b/lib/error.h
+@@ -0,0 +1,27 @@
++#ifndef _ERROR_H_
++#define _ERROR_H_
++
++#include <stdarg.h>
++#include <stdio.h>
++#include <stdlib.h>
++#include <string.h>
++#include <errno.h>
++
++static unsigned int error_message_count = 0;
++
++static inline void error(int status, int errnum, const char* format, ...)
++{
++ va_list ap;
++ fprintf(stderr, "%s: ", program_invocation_name);
++ va_start(ap, format);
++ vfprintf(stderr, format, ap);
++ va_end(ap);
++ if (errnum)
++ fprintf(stderr, ": %s", strerror(errnum));
++ fprintf(stderr, "\n");
++ error_message_count++;
++ if (status)
++ exit(status);
++}
++
++#endif /* _ERROR_H_ */
+diff --git a/lib/fixedsizehash.h b/lib/fixedsizehash.h
+index dac2a5f..43016fc 100644
+--- a/lib/fixedsizehash.h
++++ b/lib/fixedsizehash.h
+@@ -30,7 +30,6 @@
+ #include <errno.h>
+ #include <stdlib.h>
+ #include <string.h>
+-#include <sys/cdefs.h>
+
+ #include <system.h>
+
+diff --git a/lib/libeu.h b/lib/libeu.h
+index ecb4d01..edc85e3 100644
+--- a/lib/libeu.h
++++ b/lib/libeu.h
+@@ -29,6 +29,7 @@
+ #ifndef LIBEU_H
+ #define LIBEU_H
+
++#include "system.h"
+ #include <stddef.h>
+ #include <stdint.h>
+
+diff --git a/libdwfl/dwfl_error.c b/libdwfl/dwfl_error.c
+index 7bcf61c..11dcc8b 100644
+--- a/libdwfl/dwfl_error.c
++++ b/libdwfl/dwfl_error.c
+@@ -154,7 +154,16 @@ dwfl_errmsg (int error)
+ switch (error &~ 0xffff)
+ {
+ case OTHER_ERROR (ERRNO):
++#if defined(__GLIBC__)
+ return strerror_r (error & 0xffff, "bad", 0);
++#else
++ {
++ static __thread char buf[128] = "";
++ if (strerror_r (error & 0xffff, buf, sizeof(buf)) == 0)
++ return buf;
++ }
++ return "strerror_r() failed";
++#endif
+ case OTHER_ERROR (LIBELF):
+ return elf_errmsg (error & 0xffff);
+ case OTHER_ERROR (LIBDW):
+diff --git a/libdwfl/linux-kernel-modules.c b/libdwfl/linux-kernel-modules.c
+index d46ab5a..1c3faee 100644
+--- a/libdwfl/linux-kernel-modules.c
++++ b/libdwfl/linux-kernel-modules.c
+@@ -50,6 +50,7 @@
+ #include <sys/utsname.h>
+ #include <fcntl.h>
+ #include <unistd.h>
++#include "system.h"
+
+ /* If fts.h is included before config.h, its indirect inclusions may not
+ give us the right LFS aliases of these functions, so map them manually. */
+diff --git a/libelf/elf.h b/libelf/elf.h
+index bed273d..be228e6 100644
+--- a/libelf/elf.h
++++ b/libelf/elf.h
+@@ -21,7 +21,9 @@
+
+ #include <features.h>
+
+-__BEGIN_DECLS
++#ifdef __cplusplus
++extern "C" {
++#endif
+
+ /* Standard ELF types. */
+
+@@ -4029,6 +4031,7 @@ enum
+ #define R_NDS32_TLS_TPOFF 102
+ #define R_NDS32_TLS_DESC 119
+
+-__END_DECLS
+-
++#ifdef __cplusplus
++}
++#endif
+ #endif /* elf.h */
+--
+2.17.1
+
diff --git a/external/poky/meta/recipes-devtools/elfutils/files/0003-fixheadercheck.patch b/external/poky/meta/recipes-devtools/elfutils/files/0003-fixheadercheck.patch
index d1c8e414..e36d3f44 100644
--- a/external/poky/meta/recipes-devtools/elfutils/files/0003-fixheadercheck.patch
+++ b/external/poky/meta/recipes-devtools/elfutils/files/0003-fixheadercheck.patch
@@ -1,7 +1,7 @@
-From 04fb3f65ec186df5231dd0c21780a55dcc03c868 Mon Sep 17 00:00:00 2001
+From dd7c8c730457def5f62ebd43022b2f06df8c6ed9 Mon Sep 17 00:00:00 2001
From: Hongxu Jia <hongxu.jia@windriver.com>
Date: Tue, 15 Aug 2017 17:17:20 +0800
-Subject: [PATCH 3/7] fixheadercheck
+Subject: [PATCH] fixheadercheck
For some binaries we can get a invalid section alignment, for example if
sh_align = 1 and sh_addralign is 0. In the case of a zero size section
@@ -16,6 +16,7 @@ Upstream-Status: Pending
Rebase to 0.170
Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
+
---
libelf/elf32_updatenull.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
@@ -35,6 +36,3 @@ index 3e9ef61..5351518 100644
{
__libelf_seterrno (ELF_E_INVALID_ALIGN);
return -1;
---
-2.7.4
-
diff --git a/external/poky/meta/recipes-devtools/elfutils/files/0003-musl-utils.patch b/external/poky/meta/recipes-devtools/elfutils/files/0003-musl-utils.patch
new file mode 100644
index 00000000..79c9d9ad
--- /dev/null
+++ b/external/poky/meta/recipes-devtools/elfutils/files/0003-musl-utils.patch
@@ -0,0 +1,166 @@
+From 94028b16e56c8eef1aa02dcc4da268a0e471b4ea Mon Sep 17 00:00:00 2001
+From: Hongxu Jia <hongxu.jia@windriver.com>
+Date: Fri, 23 Aug 2019 10:19:48 +0800
+Subject: [PATCH 3/4] musl-utils
+
+Provide missing defines which otherwise are available on glibc system headers
+
+Alter the error API to match posix version
+use qsort instead of qsort_r which is glibc specific API
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+Upstream-Status: Inappropriate [workaround for musl]
+
+Rebase to 0.177
+Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
+
+---
+ src/arlib.h | 6 ++++++
+ src/elfcompress.c | 7 +++++++
+ src/readelf.c | 20 ++++++++++++--------
+ src/strip.c | 7 +++++++
+ src/unstrip.c | 9 +++++++++
+ 5 files changed, 41 insertions(+), 8 deletions(-)
+
+diff --git a/src/arlib.h b/src/arlib.h
+index e117166..8326f6c 100644
+--- a/src/arlib.h
++++ b/src/arlib.h
+@@ -29,6 +29,12 @@
+ #include <stdint.h>
+ #include <sys/types.h>
+
++#if !defined(ALLPERMS)
++# define ALLPERMS (S_ISUID|S_ISGID|S_ISVTX|S_IRWXU|S_IRWXG|S_IRWXO) /* 07777 */
++#endif
++#if !defined(DEFFILEMODE)
++# define DEFFILEMODE (S_IRUSR|S_IWUSR|S_IRGRP|S_IWGRP|S_IROTH|S_IWOTH)/* 0666*/
++#endif
+
+ /* State of -D/-U flags. */
+ extern bool arlib_deterministic_output;
+diff --git a/src/elfcompress.c b/src/elfcompress.c
+index 6ba6af4..0c7674b 100644
+--- a/src/elfcompress.c
++++ b/src/elfcompress.c
+@@ -37,6 +37,13 @@
+ #include "libeu.h"
+ #include "printversion.h"
+
++#if !defined(ALLPERMS)
++# define ALLPERMS (S_ISUID|S_ISGID|S_ISVTX|S_IRWXU|S_IRWXG|S_IRWXO) /* 07777 */
++#endif
++#if !defined(FNM_EXTMATCH)
++# define FNM_EXTMATCH (0)
++#endif
++
+ /* Name and version of program. */
+ ARGP_PROGRAM_VERSION_HOOK_DEF = print_version;
+
+diff --git a/src/readelf.c b/src/readelf.c
+index 5994615..f3cc071 100644
+--- a/src/readelf.c
++++ b/src/readelf.c
+@@ -4829,10 +4829,11 @@ listptr_base (struct listptr *p)
+ return cudie_base (&cu);
+ }
+
++static const char *listptr_name;
++
+ static int
+-compare_listptr (const void *a, const void *b, void *arg)
++compare_listptr (const void *a, const void *b)
+ {
+- const char *name = arg;
+ struct listptr *p1 = (void *) a;
+ struct listptr *p2 = (void *) b;
+
+@@ -4848,21 +4849,21 @@ compare_listptr (const void *a, const void *b, void *arg)
+ p1->warned = p2->warned = true;
+ error (0, 0,
+ gettext ("%s %#" PRIx64 " used with different address sizes"),
+- name, (uint64_t) p1->offset);
++ listptr_name, (uint64_t) p1->offset);
+ }
+ if (p1->dwarf64 != p2->dwarf64)
+ {
+ p1->warned = p2->warned = true;
+ error (0, 0,
+ gettext ("%s %#" PRIx64 " used with different offset sizes"),
+- name, (uint64_t) p1->offset);
++ listptr_name, (uint64_t) p1->offset);
+ }
+ if (listptr_base (p1) != listptr_base (p2))
+ {
+ p1->warned = p2->warned = true;
+ error (0, 0,
+ gettext ("%s %#" PRIx64 " used with different base addresses"),
+- name, (uint64_t) p1->offset);
++ listptr_name, (uint64_t) p1->offset);
+ }
+ if (p1->attr != p2 ->attr)
+ {
+@@ -4870,7 +4871,7 @@ compare_listptr (const void *a, const void *b, void *arg)
+ error (0, 0,
+ gettext ("%s %#" PRIx64
+ " used with different attribute %s and %s"),
+- name, (uint64_t) p1->offset, dwarf_attr_name (p2->attr),
++ listptr_name, (uint64_t) p1->offset, dwarf_attr_name (p2->attr),
+ dwarf_attr_name (p2->attr));
+ }
+ }
+@@ -4942,8 +4943,11 @@ static void
+ sort_listptr (struct listptr_table *table, const char *name)
+ {
+ if (table->n > 0)
+- qsort_r (table->table, table->n, sizeof table->table[0],
+- &compare_listptr, (void *) name);
++ {
++ listptr_name = name;
++ qsort (table->table, table->n, sizeof table->table[0],
++ &compare_listptr);
++ }
+ }
+
+ static bool
+diff --git a/src/strip.c b/src/strip.c
+index 4054c2a..d2d2176 100644
+--- a/src/strip.c
++++ b/src/strip.c
+@@ -46,6 +46,13 @@
+ #include <system.h>
+ #include <printversion.h>
+
++#if !defined(ACCESSPERMS)
++# define ACCESSPERMS (S_IRWXU|S_IRWXG|S_IRWXO) /* 0777 */
++#endif
++#if !defined(FNM_EXTMATCH)
++# define FNM_EXTMATCH (0)
++#endif
++
+ typedef uint8_t GElf_Byte;
+
+ /* Name and version of program. */
+diff --git a/src/unstrip.c b/src/unstrip.c
+index 9b8c09a..1fb5063 100644
+--- a/src/unstrip.c
++++ b/src/unstrip.c
+@@ -56,6 +56,15 @@
+ # define _(str) gettext (str)
+ #endif
+
++#ifndef strndupa
++#define strndupa(s, n) \
++ ({const char *__in = (s); \
++ size_t __len = strnlen (__in, (n)) + 1; \
++ char *__out = (char *) alloca (__len); \
++ __out[__len-1] = '\0'; \
++ (char *) memcpy (__out, __in, __len-1);})
++#endif
++
+ /* Name and version of program. */
+ ARGP_PROGRAM_VERSION_HOOK_DEF = print_version;
+
+--
+2.17.1
+
diff --git a/external/poky/meta/recipes-devtools/elfutils/files/0004-Disable-the-test-to-convert-euc-jp.patch b/external/poky/meta/recipes-devtools/elfutils/files/0004-Disable-the-test-to-convert-euc-jp.patch
index bf3a645b..5dee6121 100644
--- a/external/poky/meta/recipes-devtools/elfutils/files/0004-Disable-the-test-to-convert-euc-jp.patch
+++ b/external/poky/meta/recipes-devtools/elfutils/files/0004-Disable-the-test-to-convert-euc-jp.patch
@@ -1,7 +1,7 @@
-From dbc88349b9eed4268db951df2c3a8387f75a32e7 Mon Sep 17 00:00:00 2001
+From e4ede22e28eaa38d81667ddcb19541ece1a83cf8 Mon Sep 17 00:00:00 2001
From: Hongxu Jia <hongxu.jia@windriver.com>
Date: Tue, 15 Aug 2017 17:24:06 +0800
-Subject: [PATCH 4/7] Disable the test to convert euc-jp
+Subject: [PATCH] Disable the test to convert euc-jp
Remove the test "Test against HP-UX 11.11 bug:
No converter from EUC-JP to UTF-8 is provided"
@@ -15,6 +15,7 @@ Signed-off-by: Roy Li <rongqing.li@windriver.com>
Rebase to 0.170
Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
+
---
m4/iconv.m4 | 2 ++
1 file changed, 2 insertions(+)
@@ -39,6 +40,3 @@ index a503646..299f1eb 100644
return result;
}]])],
[am_cv_func_iconv_works=yes],
---
-2.7.4
-
diff --git a/external/poky/meta/recipes-devtools/elfutils/files/0004-Fix-error-on-musl.patch b/external/poky/meta/recipes-devtools/elfutils/files/0004-Fix-error-on-musl.patch
new file mode 100644
index 00000000..1b2f9ed9
--- /dev/null
+++ b/external/poky/meta/recipes-devtools/elfutils/files/0004-Fix-error-on-musl.patch
@@ -0,0 +1,39 @@
+From 7ff8cbecde7455b530fa7894a78d2326799f2556 Mon Sep 17 00:00:00 2001
+From: Richard Purdie <richard.purdie@linuxfoundation.org>
+Date: Wed, 1 May 2019 22:15:03 +0100
+Subject: [PATCH 4/4] Fix error on musl:
+
+| ../../elfutils-0.176/tests/elfstrmerge.c: In function 'main':
+| ../../elfutils-0.176/tests/elfstrmerge.c:370:60: error: 'ALLPERMS' undeclared (first use in this function); did you mean 'EPERM'?
+| fdnew = open (fnew, O_WRONLY | O_CREAT, st.st_mode & ALLPERMS);
+| ^~~~~~~~
+| EPERM
+| ../../elfutils-0.176/tests/elfstrmerge.c:370:60: note: each undeclared identifier is reported only once for each function it appears in
+
+Upstream-Status: Inappropriate [workaround in musl]
+
+Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
+
+---
+ tests/elfstrmerge.c | 5 +++++
+ 1 file changed, 5 insertions(+)
+
+diff --git a/tests/elfstrmerge.c b/tests/elfstrmerge.c
+index ba0d68d..1d2447f 100644
+--- a/tests/elfstrmerge.c
++++ b/tests/elfstrmerge.c
+@@ -33,6 +33,11 @@
+ #include ELFUTILS_HEADER(dwelf)
+ #include "elf-knowledge.h"
+
++/* for musl */
++#ifndef ALLPERMS
++# define ALLPERMS (S_ISUID|S_ISGID|S_ISVTX|S_IRWXU|S_IRWXG|S_IRWXO)/* 07777 */
++#endif
++
+ /* The original ELF file. */
+ static int fd = -1;
+ static Elf *elf = NULL;
+--
+2.17.1
+
diff --git a/external/poky/meta/recipes-devtools/elfutils/files/0006-Fix-build-on-aarch64-musl.patch b/external/poky/meta/recipes-devtools/elfutils/files/0006-Fix-build-on-aarch64-musl.patch
index 40b8544f..6f7956c5 100644
--- a/external/poky/meta/recipes-devtools/elfutils/files/0006-Fix-build-on-aarch64-musl.patch
+++ b/external/poky/meta/recipes-devtools/elfutils/files/0006-Fix-build-on-aarch64-musl.patch
@@ -1,7 +1,7 @@
-From b4ec05953f78af26bcd7de45a5bbc5f138d023da Mon Sep 17 00:00:00 2001
+From 578f370c7e7a9f056aefa062b34590b0aa13bce5 Mon Sep 17 00:00:00 2001
From: Hongxu Jia <hongxu.jia@windriver.com>
Date: Tue, 15 Aug 2017 17:27:30 +0800
-Subject: [PATCH 6/7] Fix build on aarch64/musl
+Subject: [PATCH] Fix build on aarch64/musl
Errors
@@ -16,6 +16,7 @@ Signed-off-by: Khem Raj <raj.khem@gmail.com>
Rebase to 0.170
Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
+
---
backends/aarch64_initreg.c | 4 ++--
backends/arm_initreg.c | 2 +-
@@ -56,6 +57,3 @@ index efcabaf..062bb9e 100644
# include <sys/user.h>
# include <sys/ptrace.h>
/* Deal with old glibc defining user_pt_regs instead of user_regs_struct. */
---
-2.7.4
-
diff --git a/external/poky/meta/recipes-devtools/elfutils/files/0007-Fix-control-path-where-we-have-str-as-uninitialized-.patch b/external/poky/meta/recipes-devtools/elfutils/files/0007-Fix-control-path-where-we-have-str-as-uninitialized-.patch
deleted file mode 100644
index bba420e3..00000000
--- a/external/poky/meta/recipes-devtools/elfutils/files/0007-Fix-control-path-where-we-have-str-as-uninitialized-.patch
+++ /dev/null
@@ -1,45 +0,0 @@
-From 8eb100b2e51be5d473b0748a223e2e7f61ec606c Mon Sep 17 00:00:00 2001
-From: Hongxu Jia <hongxu.jia@windriver.com>
-Date: Fri, 29 Jun 2018 15:14:28 +0800
-Subject: [PATCH 7/7] Fix control path where we have str as uninitialized
- string
-
-|
-/home/ubuntu/work/oe/openembedded-core/build/tmp-musl/work/i586-oe-linux-musl/elfutils/0.164-r0/elfutils-0.164/libcpu/i386_disasm.c:
-In function 'i386_disasm':
-|
-/home/ubuntu/work/oe/openembedded-core/build/tmp-musl/work/i586-oe-linux-musl/elfutils/0.164-r0/elfutils-0.164/libcpu/i386_disasm.c:310:5:
-error: 'str' may be used uninitialized in this function
-[-Werror=maybe-uninitialized]
-| memcpy (buf + bufcnt, _str, _len); \
-| ^
-|
-/home/ubuntu/work/oe/openembedded-core/build/tmp-musl/work/i586-oe-linux-musl/elfutils/0.164-r0/elfutils-0.164/libcpu/i386_disasm.c:709:17:
-note: 'str' was declared here
-| const char *str;
-
-Signed-off-by: Khem Raj <raj.khem@gmail.com>
-Upstream-Status: Pending
-
-Rebase to 0.172
-
-Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
----
- libcpu/i386_disasm.c | 1 +
- 1 file changed, 1 insertion(+)
-
-diff --git a/libcpu/i386_disasm.c b/libcpu/i386_disasm.c
-index a7e03f9..837a3a8 100644
---- a/libcpu/i386_disasm.c
-+++ b/libcpu/i386_disasm.c
-@@ -821,6 +821,7 @@ i386_disasm (Ebl *ebl __attribute__((unused)),
- }
- FALLTHROUGH;
- default:
-+ str = "";
- assert (! "INVALID not handled");
- }
- }
---
-2.7.4
-
diff --git a/external/poky/meta/recipes-devtools/elfutils/files/0008-build-Provide-alternatives-for-glibc-assumptions-hel.patch b/external/poky/meta/recipes-devtools/elfutils/files/0008-build-Provide-alternatives-for-glibc-assumptions-hel.patch
deleted file mode 100644
index 41981f4a..00000000
--- a/external/poky/meta/recipes-devtools/elfutils/files/0008-build-Provide-alternatives-for-glibc-assumptions-hel.patch
+++ /dev/null
@@ -1,226 +0,0 @@
-From 207be05c44da5c4c31179a34660e176145ff8d4b Mon Sep 17 00:00:00 2001
-From: Khem Raj <raj.khem@gmail.com>
-Date: Mon, 2 Jul 2018 09:52:23 +0800
-Subject: [PATCH] build: Provide alternatives for glibc assumptions helps
- compiling it on musl
-
-Upstream-Status: Pending
-Signed-off-by: Khem Raj <raj.khem@gmail.com>
-
-Rebase to 0.175
-
-Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
----
- Makefile.am | 2 +-
- lib/fixedsizehash.h | 1 -
- lib/system.h | 12 +++++++++++-
- libdw/Makefile.am | 3 ++-
- libdwfl/dwfl_build_id_find_elf.c | 1 +
- libdwfl/dwfl_error.c | 4 +++-
- libdwfl/dwfl_module_getdwarf.c | 1 +
- libdwfl/libdwfl_crc32_file.c | 9 +++++++++
- libdwfl/linux-kernel-modules.c | 1 +
- libelf/elf.h | 8 ++++++--
- libelf/libelf.h | 1 +
- libelf/libelfP.h | 1 +
- 12 files changed, 37 insertions(+), 7 deletions(-)
-
-diff --git a/Makefile.am b/Makefile.am
-index 2ff444e..41f77df 100644
---- a/Makefile.am
-+++ b/Makefile.am
-@@ -28,7 +28,7 @@ pkginclude_HEADERS = version.h
-
- # Add doc back when we have some real content.
- SUBDIRS = config m4 lib libelf libebl libdwelf libdwfl libdw libcpu libasm \
-- backends src po tests
-+ backends po tests
-
- EXTRA_DIST = elfutils.spec GPG-KEY NOTES CONTRIBUTING \
- COPYING COPYING-GPLV2 COPYING-LGPLV3
-diff --git a/lib/fixedsizehash.h b/lib/fixedsizehash.h
-index dac2a5f..43016fc 100644
---- a/lib/fixedsizehash.h
-+++ b/lib/fixedsizehash.h
-@@ -30,7 +30,6 @@
- #include <errno.h>
- #include <stdlib.h>
- #include <string.h>
--#include <sys/cdefs.h>
-
- #include <system.h>
-
-diff --git a/lib/system.h b/lib/system.h
-index 292082b..308a762 100644
---- a/lib/system.h
-+++ b/lib/system.h
-@@ -30,7 +30,7 @@
- #define LIB_SYSTEM_H 1
-
- #include <errno.h>
--#include <error.h>
-+#include <err.h>
- #include <stddef.h>
- #include <stdint.h>
- #include <sys/param.h>
-@@ -51,6 +51,16 @@
- #else
- # error "Unknown byte order"
- #endif
-+#ifndef TEMP_FAILURE_RETRY
-+#define TEMP_FAILURE_RETRY(expression) \
-+ (__extension__ \
-+ ({ long int __result; \
-+ do __result = (long int) (expression); \
-+ while (__result == -1L && errno == EINTR); \
-+ __result; }))
-+#endif
-+
-+#define error(status, errno, ...) err(status, __VA_ARGS__)
-
- #ifndef MAX
- #define MAX(m, n) ((m) < (n) ? (n) : (m))
-diff --git a/libdw/Makefile.am b/libdw/Makefile.am
-index 7a3d532..7ac1241 100644
---- a/libdw/Makefile.am
-+++ b/libdw/Makefile.am
-@@ -108,7 +108,8 @@ am_libdw_pic_a_OBJECTS = $(libdw_a_SOURCES:.c=.os)
- libdw_so_LIBS = libdw_pic.a ../libdwelf/libdwelf_pic.a \
- ../libdwfl/libdwfl_pic.a ../libebl/libebl.a
- libdw_so_DEPS = ../lib/libeu.a ../libelf/libelf.so
--libdw_so_LDLIBS = $(libdw_so_DEPS) -ldl -lz $(argp_LDADD) $(zip_LIBS)
-+fts_LDADD = -lfts
-+libdw_so_LDLIBS = $(libdw_so_DEPS) -ldl -lz $(argp_LDADD) $(zip_LIBS) $(fts_LDADD)
- libdw_so_SOURCES =
- libdw.so$(EXEEXT): $(srcdir)/libdw.map $(libdw_so_LIBS) $(libdw_so_DEPS)
- # The rpath is necessary for libebl because its $ORIGIN use will
-diff --git a/libdwfl/dwfl_build_id_find_elf.c b/libdwfl/dwfl_build_id_find_elf.c
-index cc6c3f6..b06ab59 100644
---- a/libdwfl/dwfl_build_id_find_elf.c
-+++ b/libdwfl/dwfl_build_id_find_elf.c
-@@ -31,6 +31,7 @@
- #endif
-
- #include "libdwflP.h"
-+#include "system.h"
- #include <inttypes.h>
- #include <fcntl.h>
- #include <unistd.h>
-diff --git a/libdwfl/dwfl_error.c b/libdwfl/dwfl_error.c
-index 7bcf61c..c345797 100644
---- a/libdwfl/dwfl_error.c
-+++ b/libdwfl/dwfl_error.c
-@@ -140,6 +140,7 @@ __libdwfl_seterrno (Dwfl_Error error)
- const char *
- dwfl_errmsg (int error)
- {
-+ static __thread char s[64] = "";
- if (error == 0 || error == -1)
- {
- int last_error = global_error;
-@@ -154,7 +155,8 @@ dwfl_errmsg (int error)
- switch (error &~ 0xffff)
- {
- case OTHER_ERROR (ERRNO):
-- return strerror_r (error & 0xffff, "bad", 0);
-+ strerror_r (error & 0xffff, s, sizeof(s));
-+ return s;
- case OTHER_ERROR (LIBELF):
- return elf_errmsg (error & 0xffff);
- case OTHER_ERROR (LIBDW):
-diff --git a/libdwfl/dwfl_module_getdwarf.c b/libdwfl/dwfl_module_getdwarf.c
-index 56e6105..f4a0649 100644
---- a/libdwfl/dwfl_module_getdwarf.c
-+++ b/libdwfl/dwfl_module_getdwarf.c
-@@ -35,6 +35,7 @@
- #include <fcntl.h>
- #include <string.h>
- #include <unistd.h>
-+#include "system.h"
- #include "../libdw/libdwP.h" /* DWARF_E_* values are here. */
- #include "../libelf/libelfP.h"
- #include "system.h"
-diff --git a/libdwfl/libdwfl_crc32_file.c b/libdwfl/libdwfl_crc32_file.c
-index f849128..6f0aca1 100644
---- a/libdwfl/libdwfl_crc32_file.c
-+++ b/libdwfl/libdwfl_crc32_file.c
-@@ -29,6 +29,15 @@
- # include <config.h>
- #endif
-
-+#ifndef TEMP_FAILURE_RETRY
-+#define TEMP_FAILURE_RETRY(expression) \
-+ (__extension__ \
-+ ({ long int __result; \
-+ do __result = (long int) (expression); \
-+ while (__result == -1L && errno == EINTR); \
-+ __result; }))
-+#endif
-+
- #define crc32_file attribute_hidden __libdwfl_crc32_file
- #define crc32 __libdwfl_crc32
- #include <libdwflP.h>
-diff --git a/libdwfl/linux-kernel-modules.c b/libdwfl/linux-kernel-modules.c
-index 360e4ee..b5aa397 100644
---- a/libdwfl/linux-kernel-modules.c
-+++ b/libdwfl/linux-kernel-modules.c
-@@ -41,6 +41,7 @@
-
- #include "libelfP.h"
- #include "libdwflP.h"
-+#include "system.h"
- #include <inttypes.h>
- #include <errno.h>
- #include <stdio.h>
-diff --git a/libelf/elf.h b/libelf/elf.h
-index 5dc632b..14da1b7 100644
---- a/libelf/elf.h
-+++ b/libelf/elf.h
-@@ -21,7 +21,9 @@
-
- #include <features.h>
-
--__BEGIN_DECLS
-+#ifdef __cplusplus
-+extern "C" {
-+#endif
-
- /* Standard ELF types. */
-
-@@ -3937,6 +3939,8 @@ enum
- #define R_METAG_TLS_LE_HI16 60
- #define R_METAG_TLS_LE_LO16 61
-
--__END_DECLS
-+#ifdef __cplusplus
-+}
-+#endif
-
- #endif /* elf.h */
-diff --git a/libelf/libelf.h b/libelf/libelf.h
-index 1ff11c9..c21e018 100644
---- a/libelf/libelf.h
-+++ b/libelf/libelf.h
-@@ -29,6 +29,7 @@
- #ifndef _LIBELF_H
- #define _LIBELF_H 1
-
-+#include <fcntl.h>
- #include <stdint.h>
- #include <sys/types.h>
-
-diff --git a/libelf/libelfP.h b/libelf/libelfP.h
-index 9f3e8e9..10a347a 100644
---- a/libelf/libelfP.h
-+++ b/libelf/libelfP.h
-@@ -32,6 +32,7 @@
-
- #include <ar.h>
- #include <gelf.h>
-+#include <libelf.h>
-
- #include <errno.h>
- #include <stdbool.h>
---
-2.7.4
-
diff --git a/external/poky/meta/recipes-devtools/elfutils/files/CVE-2019-7146_p1.patch b/external/poky/meta/recipes-devtools/elfutils/files/CVE-2019-7146_p1.patch
deleted file mode 100644
index b6cd29af..00000000
--- a/external/poky/meta/recipes-devtools/elfutils/files/CVE-2019-7146_p1.patch
+++ /dev/null
@@ -1,52 +0,0 @@
-From 012018907ca05eb0ab51d424a596ef38fc87cae1 Mon Sep 17 00:00:00 2001
-From: Mark Wielaard <mark@klomp.org>
-Date: Wed, 16 Jan 2019 11:57:35 +0100
-Subject: [PATCH] libebl: Check GNU property note pr_datasz fits inside note
- description.
-
-Before printing the data values, make sure pr_datasz doesn't go beyond
-the end of the note description data.
-
-https://sourceware.org/bugzilla/show_bug.cgi?id=24075
-
-Signed-off-by: Mark Wielaard <mark@klomp.org>
-
-Upstream-Status: Backport
-CVE: CVE-2019-7146 patch #1
-Signed-off-by: Armin Kuster <akuster@mvista.com>
-
----
- libebl/ChangeLog | 4 ++++
- libebl/eblobjnote.c | 7 +++++++
- 2 files changed, 11 insertions(+)
-
-Index: elfutils-0.175/libebl/eblobjnote.c
-===================================================================
---- elfutils-0.175.orig/libebl/eblobjnote.c
-+++ elfutils-0.175/libebl/eblobjnote.c
-@@ -350,6 +350,13 @@ ebl_object_note (Ebl *ebl, uint32_t name
- desc += 8;
- descsz -= 8;
-
-+ if (prop.pr_datasz > descsz)
-+ {
-+ printf ("BAD property datasz: %" PRId32 "\n",
-+ prop.pr_datasz);
-+ return;
-+ }
-+
- int elfclass = gelf_getclass (ebl->elf);
- char *elfident = elf_getident (ebl->elf, NULL);
- GElf_Ehdr ehdr;
-Index: elfutils-0.175/libebl/ChangeLog
-===================================================================
---- elfutils-0.175.orig/libebl/ChangeLog
-+++ elfutils-0.175/libebl/ChangeLog
-@@ -1,3 +1,7 @@
-+2019-01-16 Mark Wielaard <mark@klomp.org>
-+
-+ * eblobjnte.c (ebl_object_note): Check pr_datasz isn't too large.
-+
- 2018-11-15 Mark Wielaard <mark@klomp.org>
-
- * eblobjnotetypename.c (ebl_object_note_type_name): Don't update
diff --git a/external/poky/meta/recipes-devtools/elfutils/files/CVE-2019-7146_p2.patch b/external/poky/meta/recipes-devtools/elfutils/files/CVE-2019-7146_p2.patch
deleted file mode 100644
index 4434b365..00000000
--- a/external/poky/meta/recipes-devtools/elfutils/files/CVE-2019-7146_p2.patch
+++ /dev/null
@@ -1,65 +0,0 @@
-From cd7ded3df43f655af945c869976401a602e46fcd Mon Sep 17 00:00:00 2001
-From: Mark Wielaard <mark@klomp.org>
-Date: Wed, 30 Jan 2019 00:04:11 +0100
-Subject: [PATCH] libebl: Check GNU property note data padding fits inside
- note.
-
-The GNU property note data is padded. Make sure the extra padding
-still fits in the note description.
-
-https://sourceware.org/bugzilla/show_bug.cgi?id=24075
-
-Signed-off-by: Mark Wielaard <mark@klomp.org>
-
-Upstream-Status: Backport
-CVE: CVE-2019-7146 patch #2
-Signed-off-by: Armin Kuster <akuster@mvista.com>
-
----
- libebl/ChangeLog | 5 +++++
- libebl/eblobjnote.c | 17 +++++++++--------
- 2 files changed, 14 insertions(+), 8 deletions(-)
-
-Index: elfutils-0.175/libebl/ChangeLog
-===================================================================
---- elfutils-0.175.orig/libebl/ChangeLog
-+++ elfutils-0.175/libebl/ChangeLog
-@@ -1,3 +1,8 @@
-+2019-01-29 Mark Wielaard <mark@klomp.org>
-+
-+ * eblobjnote.c (ebl_object_note): Check pr_datasz padding doesn't
-+ overflow descsz.
-+
- 2019-01-16 Mark Wielaard <mark@klomp.org>
-
- * eblobjnte.c (ebl_object_note): Check pr_datasz isn't too large.
-Index: elfutils-0.175/libebl/eblobjnote.c
-===================================================================
---- elfutils-0.175.orig/libebl/eblobjnote.c
-+++ elfutils-0.175/libebl/eblobjnote.c
-@@ -486,16 +486,17 @@ ebl_object_note (Ebl *ebl, uint32_t name
- printf ("%02" PRIx8 "\n", (uint8_t) desc[i]);
- }
- }
-+
- if (elfclass == ELFCLASS32)
-- {
-- desc += NOTE_ALIGN4 (prop.pr_datasz);
-- descsz -= NOTE_ALIGN4 (prop.pr_datasz);
-- }
-+ prop.pr_datasz = NOTE_ALIGN4 (prop.pr_datasz);
- else
-- {
-- desc += NOTE_ALIGN8 (prop.pr_datasz);
-- descsz -= NOTE_ALIGN8 (prop.pr_datasz);
-- }
-+ prop.pr_datasz = NOTE_ALIGN8 (prop.pr_datasz);
-+
-+ desc += prop.pr_datasz;
-+ if (descsz > prop.pr_datasz)
-+ descsz -= prop.pr_datasz;
-+ else
-+ descsz = 0;
- }
- }
- break;
diff --git a/external/poky/meta/recipes-devtools/elfutils/files/CVE-2019-7149.patch b/external/poky/meta/recipes-devtools/elfutils/files/CVE-2019-7149.patch
deleted file mode 100644
index 215a1715..00000000
--- a/external/poky/meta/recipes-devtools/elfutils/files/CVE-2019-7149.patch
+++ /dev/null
@@ -1,148 +0,0 @@
-From 2562759d6fe5b364fe224852e64e8bda39eb2e35 Mon Sep 17 00:00:00 2001
-From: Mark Wielaard <mark@klomp.org>
-Date: Sun, 20 Jan 2019 22:10:18 +0100
-Subject: [PATCH] libdw: Check terminating NUL byte in dwarf_getsrclines for
- dir/file table.
-
-For DWARF version < 5 the .debug_line directory and file tables consist
-of a terminating NUL byte after all strings. The code used to just skip
-this without checking it actually existed. This could case a spurious
-read past the end of data.
-
-Fix the same issue in readelf.
-
-https://sourceware.org/bugzilla/show_bug.cgi?id=24102
-
-Signed-off-by: Mark Wielaard <mark@klomp.org>
-
-Upstream-Status: Backport
-CVE: CVE-2019-7149
-Signed-off-by: Armin Kuster <akuster@mvista.com>
-
----
- libdw/ChangeLog | 5 +++++
- libdw/dwarf_getsrclines.c | 11 ++++++++---
- src/ChangeLog | 5 +++++
- src/readelf.c | 8 ++++++--
- 4 files changed, 24 insertions(+), 5 deletions(-)
-
-Index: elfutils-0.175/libdw/dwarf_getsrclines.c
-===================================================================
---- elfutils-0.175.orig/libdw/dwarf_getsrclines.c
-+++ elfutils-0.175/libdw/dwarf_getsrclines.c
-@@ -315,7 +315,7 @@ read_srclines (Dwarf *dbg,
- if (version < 5)
- {
- const unsigned char *dirp = linep;
-- while (*dirp != 0)
-+ while (dirp < lineendp && *dirp != 0)
- {
- uint8_t *endp = memchr (dirp, '\0', lineendp - dirp);
- if (endp == NULL)
-@@ -323,6 +323,8 @@ read_srclines (Dwarf *dbg,
- ++ndirs;
- dirp = endp + 1;
- }
-+ if (dirp >= lineendp || *dirp != '\0')
-+ goto invalid_data;
- ndirs = ndirs + 1; /* There is always the "unknown" dir. */
- }
- else
-@@ -392,11 +394,12 @@ read_srclines (Dwarf *dbg,
- {
- dirarray[n].dir = (char *) linep;
- uint8_t *endp = memchr (linep, '\0', lineendp - linep);
-- assert (endp != NULL);
-+ assert (endp != NULL); // Checked above when calculating ndirlist.
- dirarray[n].len = endp - linep;
- linep = endp + 1;
- }
- /* Skip the final NUL byte. */
-+ assert (*linep == '\0'); // Checked above when calculating ndirlist.
- ++linep;
- }
- else
-@@ -471,7 +474,7 @@ read_srclines (Dwarf *dbg,
- {
- if (unlikely (linep >= lineendp))
- goto invalid_data;
-- while (*linep != 0)
-+ while (linep < lineendp && *linep != '\0')
- {
- struct filelist *new_file = NEW_FILE ();
-
-@@ -527,6 +530,8 @@ read_srclines (Dwarf *dbg,
- goto invalid_data;
- get_uleb128 (new_file->info.length, linep, lineendp);
- }
-+ if (linep >= lineendp || *linep != '\0')
-+ goto invalid_data;
- /* Skip the final NUL byte. */
- ++linep;
- }
-Index: elfutils-0.175/src/readelf.c
-===================================================================
---- elfutils-0.175.orig/src/readelf.c
-+++ elfutils-0.175/src/readelf.c
-@@ -8444,7 +8444,7 @@ print_debug_line_section (Dwfl_Module *d
- }
- else
- {
-- while (*linep != 0)
-+ while (linep < lineendp && *linep != 0)
- {
- unsigned char *endp = memchr (linep, '\0', lineendp - linep);
- if (unlikely (endp == NULL))
-@@ -8454,6 +8454,8 @@ print_debug_line_section (Dwfl_Module *d
-
- linep = endp + 1;
- }
-+ if (linep >= lineendp || *linep != 0)
-+ goto invalid_unit;
- /* Skip the final NUL byte. */
- ++linep;
- }
-@@ -8523,7 +8525,7 @@ print_debug_line_section (Dwfl_Module *d
- else
- {
- puts (gettext (" Entry Dir Time Size Name"));
-- for (unsigned int cnt = 1; *linep != 0; ++cnt)
-+ for (unsigned int cnt = 1; linep < lineendp && *linep != 0; ++cnt)
- {
- /* First comes the file name. */
- char *fname = (char *) linep;
-@@ -8553,6 +8555,8 @@ print_debug_line_section (Dwfl_Module *d
- printf (" %-5u %-5u %-9u %-9u %s\n",
- cnt, diridx, mtime, fsize, fname);
- }
-+ if (linep >= lineendp || *linep != '\0')
-+ goto invalid_unit;
- /* Skip the final NUL byte. */
- ++linep;
- }
-Index: elfutils-0.175/libdw/ChangeLog
-===================================================================
---- elfutils-0.175.orig/libdw/ChangeLog
-+++ elfutils-0.175/libdw/ChangeLog
-@@ -1,3 +1,8 @@
-+2019-01-20 Mark Wielaard <mark@klomp.org>
-+
-+ * dwarf_getsrclines.c (read_srclines): Check terminating NUL byte
-+ for dir and file lists.
-+
- 2018-10-20 Mark Wielaard <mark@klomp.org>
-
- * libdw.map (ELFUTILS_0.175): New section. Add dwelf_elf_begin.
-Index: elfutils-0.175/src/ChangeLog
-===================================================================
---- elfutils-0.175.orig/src/ChangeLog
-+++ elfutils-0.175/src/ChangeLog
-@@ -1,3 +1,8 @@
-+2019-01-20 Mark Wielaard <mark@klomp.org>
-+
-+ * readelf.c (print_debug_line_section): Check terminating NUL byte
-+ for dir and file tables.
-+
- 2018-11-10 Mark Wielaard <mark@klomp.org>
-
- * elflint.c (check_program_header): Allow PT_GNU_EH_FRAME segment
diff --git a/external/poky/meta/recipes-devtools/elfutils/files/CVE-2019-7150.patch b/external/poky/meta/recipes-devtools/elfutils/files/CVE-2019-7150.patch
deleted file mode 100644
index 01a4fb15..00000000
--- a/external/poky/meta/recipes-devtools/elfutils/files/CVE-2019-7150.patch
+++ /dev/null
@@ -1,51 +0,0 @@
-From da5c5336a1eaf519de246f7d9f0f5585e1d4ac59 Mon Sep 17 00:00:00 2001
-From: Mark Wielaard <mark@klomp.org>
-Date: Sun, 20 Jan 2019 23:05:56 +0100
-Subject: [PATCH] libdwfl: Sanity check partial core file dyn data read.
-
-When reading the dyn data from the core file check if we got everything,
-or just part of the data.
-
-https://sourceware.org/bugzilla/show_bug.cgi?id=24103
-
-Signed-off-by: Mark Wielaard <mark@klomp.org>
-
-Upstream-Status: Backport
-CVE: CVE-2019-7150
-Signed-off-by: Armin Kuster <akuster@mvista.com>
-
----
- libdwfl/ChangeLog | 5 +++++
- libdwfl/dwfl_segment_report_module.c | 6 ++++++
- 2 files changed, 11 insertions(+)
-
-Index: elfutils-0.175/libdwfl/dwfl_segment_report_module.c
-===================================================================
---- elfutils-0.175.orig/libdwfl/dwfl_segment_report_module.c
-+++ elfutils-0.175/libdwfl/dwfl_segment_report_module.c
-@@ -783,6 +783,12 @@ dwfl_segment_report_module (Dwfl *dwfl,
- if (dyn_filesz != 0 && dyn_filesz % dyn_entsize == 0
- && ! read_portion (&dyn_data, &dyn_data_size, dyn_vaddr, dyn_filesz))
- {
-+ /* dyn_data_size will be zero if we got everything from the initial
-+ buffer, otherwise it will be the size of the new buffer that
-+ could be read. */
-+ if (dyn_data_size != 0)
-+ dyn_filesz = dyn_data_size;
-+
- void *dyns = malloc (dyn_filesz);
- Elf32_Dyn (*d32)[dyn_filesz / sizeof (Elf32_Dyn)] = dyns;
- Elf64_Dyn (*d64)[dyn_filesz / sizeof (Elf64_Dyn)] = dyns;
-Index: elfutils-0.175/libdwfl/ChangeLog
-===================================================================
---- elfutils-0.175.orig/libdwfl/ChangeLog
-+++ elfutils-0.175/libdwfl/ChangeLog
-@@ -1,3 +1,8 @@
-+2019-01-20 Mark Wielaard <mark@klomp.org>
-+
-+ * dwfl_segment_report_module.c (dwfl_segment_report_module): Check
-+ dyn_filesz vs dyn_data_size after read_portion call.
-+
- 2018-10-20 Mark Wielaard <mark@klomp.org>
-
- * libdwflP.h (__libdw_open_elf): New internal function declaration.
diff --git a/external/poky/meta/recipes-devtools/elfutils/files/CVE-2019-7664.patch b/external/poky/meta/recipes-devtools/elfutils/files/CVE-2019-7664.patch
deleted file mode 100644
index e55dc5a0..00000000
--- a/external/poky/meta/recipes-devtools/elfutils/files/CVE-2019-7664.patch
+++ /dev/null
@@ -1,65 +0,0 @@
-From 3ed05376e7b2c96c1d6eb24d2842cc25b79a4f07 Mon Sep 17 00:00:00 2001
-From: Mark Wielaard <mark@klomp.org>
-Date: Wed, 16 Jan 2019 12:25:57 +0100
-Subject: [PATCH] CVE: CVE-2019-7664
-
-Upstream-Status: Backport
-libelf: Correct overflow check in note_xlate.
-
-We want to make sure the note_len doesn't overflow and becomes shorter
-than the note header. But the namesz and descsz checks got the note header
-size wrong). Replace the wrong constant (8) with a sizeof cvt_Nhdr (12).
-
-https://sourceware.org/bugzilla/show_bug.cgi?id=24084
-
-Signed-off-by: Mark Wielaard <mark@klomp.org>
-Signed-off-by: Ubuntu <lisa@shuagr-yocto-build.mdn4q2lr1oauhmizmzsslly3ad.xx.internal.cloudapp.net>
----
- libelf/ChangeLog | 13 +++++++++++++
- libelf/note_xlate.h | 4 ++--
- 2 files changed, 15 insertions(+), 2 deletions(-)
-
-diff --git a/libelf/ChangeLog b/libelf/ChangeLog
-index 68c4fbd..892e6e7 100644
---- a/libelf/ChangeLog
-+++ b/libelf/ChangeLog
-@@ -1,3 +1,16 @@
-+<<<<<<< HEAD
-+=======
-+2019-01-16 Mark Wielaard <mark@klomp.org>
-+
-+ * note_xlate.h (elf_cvt_note): Check n_namesz and n_descsz don't
-+ overflow note_len into note header.
-+
-+2018-11-17 Mark Wielaard <mark@klomp.org>
-+
-+ * elf32_updatefile.c (updatemmap): Make sure to call convert
-+ function on a properly aligned destination.
-+
-+>>>>>>> e65d91d... libelf: Correct overflow check in note_xlate.
- 2018-11-16 Mark Wielaard <mark@klomp.org>
-
- * libebl.h (__elf32_msize): Mark with const attribute.
-diff --git a/libelf/note_xlate.h b/libelf/note_xlate.h
-index 9bdc3e2..bc9950f 100644
---- a/libelf/note_xlate.h
-+++ b/libelf/note_xlate.h
-@@ -46,13 +46,13 @@ elf_cvt_note (void *dest, const void *src, size_t len, int encode,
- /* desc needs to be aligned. */
- note_len += n->n_namesz;
- note_len = nhdr8 ? NOTE_ALIGN8 (note_len) : NOTE_ALIGN4 (note_len);
-- if (note_len > len || note_len < 8)
-+ if (note_len > len || note_len < sizeof *n)
- break;
-
- /* data as a whole needs to be aligned. */
- note_len += n->n_descsz;
- note_len = nhdr8 ? NOTE_ALIGN8 (note_len) : NOTE_ALIGN4 (note_len);
-- if (note_len > len || note_len < 8)
-+ if (note_len > len || note_len < sizeof *n)
- break;
-
- /* Copy or skip the note data. */
---
-2.7.4
-
diff --git a/external/poky/meta/recipes-devtools/elfutils/files/CVE-2019-7665.patch b/external/poky/meta/recipes-devtools/elfutils/files/CVE-2019-7665.patch
deleted file mode 100644
index a1bb3097..00000000
--- a/external/poky/meta/recipes-devtools/elfutils/files/CVE-2019-7665.patch
+++ /dev/null
@@ -1,154 +0,0 @@
-From 4323d46c4a369b614aa1f574805860b3434552df Mon Sep 17 00:00:00 2001
-From: Mark Wielaard <mark@klomp.org>
-Date: Wed, 16 Jan 2019 15:41:31 +0100
-Subject: [PATCH] CVE: CVE-2019-7665
-
-Upstream-Status: Backport
-
-Sign off: Shubham Agrawal <shuagr@microsoft.com>
-
-libebl: Check NT_PLATFORM core notes contain a zero terminated string.
-
-Most strings in core notes are fixed size. But NT_PLATFORM contains just
-a variable length string. Check that it is actually zero terminated
-before passing to readelf to print.
-
-https://sourceware.org/bugzilla/show_bug.cgi?id=24089
-
-Signed-off-by: Mark Wielaard <mark@klomp.org>
-Signed-off-by: Ubuntu <lisa@shuagr-yocto-build.mdn4q2lr1oauhmizmzsslly3ad.xx.internal.cloudapp.net>
----
- libdwfl/linux-core-attach.c | 9 +++++----
- libebl/eblcorenote.c | 39 +++++++++++++++++++--------------------
- libebl/libebl.h | 3 ++-
- src/readelf.c | 2 +-
- 4 files changed, 27 insertions(+), 26 deletions(-)
-
-diff --git a/libdwfl/linux-core-attach.c b/libdwfl/linux-core-attach.c
-index 6c99b9e..c0f1b0d 100644
---- a/libdwfl/linux-core-attach.c
-+++ b/libdwfl/linux-core-attach.c
-@@ -137,7 +137,7 @@ core_next_thread (Dwfl *dwfl __attribute__ ((unused)), void *dwfl_arg,
- const Ebl_Register_Location *reglocs;
- size_t nitems;
- const Ebl_Core_Item *items;
-- if (! ebl_core_note (core_arg->ebl, &nhdr, name,
-+ if (! ebl_core_note (core_arg->ebl, &nhdr, name, desc,
- &regs_offset, &nregloc, &reglocs, &nitems, &items))
- {
- /* This note may be just not recognized, skip it. */
-@@ -191,8 +191,9 @@ core_set_initial_registers (Dwfl_Thread *thread, void *thread_arg_voidp)
- const Ebl_Register_Location *reglocs;
- size_t nitems;
- const Ebl_Core_Item *items;
-- int core_note_err = ebl_core_note (core_arg->ebl, &nhdr, name, &regs_offset,
-- &nregloc, &reglocs, &nitems, &items);
-+ int core_note_err = ebl_core_note (core_arg->ebl, &nhdr, name, desc,
-+ &regs_offset, &nregloc, &reglocs,
-+ &nitems, &items);
- /* __libdwfl_attach_state_for_core already verified the note is there. */
- assert (core_note_err != 0);
- assert (nhdr.n_type == NT_PRSTATUS);
-@@ -383,7 +384,7 @@ dwfl_core_file_attach (Dwfl *dwfl, Elf *core)
- const Ebl_Register_Location *reglocs;
- size_t nitems;
- const Ebl_Core_Item *items;
-- if (! ebl_core_note (ebl, &nhdr, name,
-+ if (! ebl_core_note (ebl, &nhdr, name, desc,
- &regs_offset, &nregloc, &reglocs, &nitems, &items))
- {
- /* This note may be just not recognized, skip it. */
-diff --git a/libebl/eblcorenote.c b/libebl/eblcorenote.c
-index 783f981..7fab397 100644
---- a/libebl/eblcorenote.c
-+++ b/libebl/eblcorenote.c
-@@ -36,11 +36,13 @@
- #include <inttypes.h>
- #include <stdio.h>
- #include <stddef.h>
-+#include <string.h>
- #include <libeblP.h>
-
-
- int
- ebl_core_note (Ebl *ebl, const GElf_Nhdr *nhdr, const char *name,
-+ const char *desc,
- GElf_Word *regs_offset, size_t *nregloc,
- const Ebl_Register_Location **reglocs, size_t *nitems,
- const Ebl_Core_Item **items)
-@@ -51,28 +53,25 @@ ebl_core_note (Ebl *ebl, const GElf_Nhdr *nhdr, const char *name,
- {
- /* The machine specific function did not know this type. */
-
-- *regs_offset = 0;
-- *nregloc = 0;
-- *reglocs = NULL;
-- switch (nhdr->n_type)
-+ /* NT_PLATFORM is kind of special since it needs a zero terminated
-+ string (other notes often have a fixed size string). */
-+ static const Ebl_Core_Item platform[] =
- {
--#define ITEMS(type, table) \
-- case type: \
-- *items = table; \
-- *nitems = sizeof table / sizeof table[0]; \
-- result = 1; \
-- break
-+ {
-+ .name = "Platform",
-+ .type = ELF_T_BYTE, .count = 0, .format = 's'
-+ }
-+ };
-
-- static const Ebl_Core_Item platform[] =
-- {
-- {
-- .name = "Platform",
-- .type = ELF_T_BYTE, .count = 0, .format = 's'
-- }
-- };
-- ITEMS (NT_PLATFORM, platform);
--
--#undef ITEMS
-+ if (nhdr->n_type == NT_PLATFORM
-+ && memchr (desc, '\0', nhdr->n_descsz) != NULL)
-+ {
-+ *regs_offset = 0;
-+ *nregloc = 0;
-+ *reglocs = NULL;
-+ *items = platform;
-+ *nitems = 1;
-+ result = 1;
- }
- }
-
-diff --git a/libebl/libebl.h b/libebl/libebl.h
-index ca9b9fe..24922eb 100644
---- a/libebl/libebl.h
-+++ b/libebl/libebl.h
-@@ -319,7 +319,8 @@ typedef struct
-
- /* Describe the format of a core file note with the given header and NAME.
- NAME is not guaranteed terminated, it's NHDR->n_namesz raw bytes. */
--extern int ebl_core_note (Ebl *ebl, const GElf_Nhdr *nhdr, const char *name,
-+extern int ebl_core_note (Ebl *ebl, const GElf_Nhdr *nhdr,
-+ const char *name, const char *desc,
- GElf_Word *regs_offset, size_t *nregloc,
- const Ebl_Register_Location **reglocs,
- size_t *nitems, const Ebl_Core_Item **items)
-diff --git a/src/readelf.c b/src/readelf.c
-index 3a73710..71651e0 100644
---- a/src/readelf.c
-+++ b/src/readelf.c
-@@ -12153,7 +12153,7 @@ handle_core_note (Ebl *ebl, const GElf_Nhdr *nhdr,
- size_t nitems;
- const Ebl_Core_Item *items;
-
-- if (! ebl_core_note (ebl, nhdr, name,
-+ if (! ebl_core_note (ebl, nhdr, name, desc,
- &regs_offset, &nregloc, &reglocs, &nitems, &items))
- return;
-
---
-2.7.4
-
diff --git a/external/poky/meta/recipes-devtools/elfutils/files/debian/0001-Ignore-differences-between-mips-machine-identifiers.patch b/external/poky/meta/recipes-devtools/elfutils/files/debian/0001-Ignore-differences-between-mips-machine-identifiers.patch
index fa3a3c66..a2983c57 100644
--- a/external/poky/meta/recipes-devtools/elfutils/files/debian/0001-Ignore-differences-between-mips-machine-identifiers.patch
+++ b/external/poky/meta/recipes-devtools/elfutils/files/debian/0001-Ignore-differences-between-mips-machine-identifiers.patch
@@ -8,6 +8,7 @@ from the elf machine id. Also, the EM_MIPS_RS3_LE machine is dead anyway (the
kernel will not load binaries containing it).
Signed-off-by: James Cowgill <james410@cowgill.org.uk>
+
Upstream-Status: Pending [from debian]
Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
---
diff --git a/external/poky/meta/recipes-devtools/elfutils/files/debian/0001-fix-compile-failure-with-debian-patches.patch b/external/poky/meta/recipes-devtools/elfutils/files/debian/0001-fix-compile-failure-with-debian-patches.patch
new file mode 100644
index 00000000..19a20150
--- /dev/null
+++ b/external/poky/meta/recipes-devtools/elfutils/files/debian/0001-fix-compile-failure-with-debian-patches.patch
@@ -0,0 +1,48 @@
+From 3f3e7b16934ec58ab47d2bdc9982f54a55b07534 Mon Sep 17 00:00:00 2001
+From: Hongxu Jia <hongxu.jia@windriver.com>
+Date: Wed, 21 Aug 2019 16:25:33 +0800
+Subject: [PATCH] fix compile failure with debian patches
+
+While applying debian patches, there is a compile failure
+...
+elfutils-0.177/backends/mips_init.c:48:5: error: 'Ebl' {aka 'struct ebl'} has no member named 'name'
+...
+
+Since upstream applied commit [b323391 libdwelf: Add dwelf_elf_e_machine_string
+and use it in readelf], it remove 'name' from 'struct ebl'
+
+Upstream-Status: Pending
+
+Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
+---
+ backends/mips_init.c | 1 -
+ backends/parisc_init.c | 1 -
+ 2 files changed, 2 deletions(-)
+
+diff --git a/backends/mips_init.c b/backends/mips_init.c
+index bce5abe..e1c65c8 100644
+--- a/backends/mips_init.c
++++ b/backends/mips_init.c
+@@ -45,7 +45,6 @@ mips_init (Elf *elf __attribute__ ((unused)),
+ return NULL;
+
+ /* We handle it. */
+- eh->name = "MIPS";
+ mips_init_reloc (eh);
+ HOOK (eh, reloc_simple_type);
+ HOOK (eh, return_value_location);
+diff --git a/backends/parisc_init.c b/backends/parisc_init.c
+index f1e401c..97b4a8c 100644
+--- a/backends/parisc_init.c
++++ b/backends/parisc_init.c
+@@ -56,7 +56,6 @@ parisc_init (Elf *elf __attribute__ ((unused)),
+ pa64 = 1;
+ }
+ /* We handle it. */
+- eh->name = "PA-RISC";
+ parisc_init_reloc (eh);
+ HOOK (eh, reloc_simple_type);
+ HOOK (eh, machine_flag_check);
+--
+2.7.4
+
diff --git a/external/poky/meta/recipes-devtools/elfutils/files/debian/0002-Add-support-for-mips64-abis-in-mips_retval.c.patch b/external/poky/meta/recipes-devtools/elfutils/files/debian/0002-Add-support-for-mips64-abis-in-mips_retval.c.patch
index 1ab704e6..aee00cba 100644
--- a/external/poky/meta/recipes-devtools/elfutils/files/debian/0002-Add-support-for-mips64-abis-in-mips_retval.c.patch
+++ b/external/poky/meta/recipes-devtools/elfutils/files/debian/0002-Add-support-for-mips64-abis-in-mips_retval.c.patch
@@ -4,6 +4,7 @@ Date: Mon, 5 Jan 2015 15:17:01 +0000
Subject: [PATCH 2/3] Add support for mips64 abis in mips_retval.c
Signed-off-by: James Cowgill <james410@cowgill.org.uk>
+
Upstream-Status: Pending [from debian]
Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
---
diff --git a/external/poky/meta/recipes-devtools/elfutils/files/debian/0003-Add-mips-n64-relocation-format-hack.patch b/external/poky/meta/recipes-devtools/elfutils/files/debian/0003-Add-mips-n64-relocation-format-hack.patch
index b196802b..c949e965 100644
--- a/external/poky/meta/recipes-devtools/elfutils/files/debian/0003-Add-mips-n64-relocation-format-hack.patch
+++ b/external/poky/meta/recipes-devtools/elfutils/files/debian/0003-Add-mips-n64-relocation-format-hack.patch
@@ -12,6 +12,7 @@ This patch also ensures that strip.c sets the correct value of e_machine
before manipulating relocations so that these changes take effect.
Signed-off-by: James Cowgill <james410@cowgill.org.uk>
+
Upstream-Status: Pending [from debian]
Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
---
diff --git a/external/poky/meta/recipes-devtools/elfutils/files/debian/arm_backend.diff b/external/poky/meta/recipes-devtools/elfutils/files/debian/arm_backend.diff
index f7258a8d..ba0ce33b 100644
--- a/external/poky/meta/recipes-devtools/elfutils/files/debian/arm_backend.diff
+++ b/external/poky/meta/recipes-devtools/elfutils/files/debian/arm_backend.diff
@@ -1,10 +1,27 @@
+From 4e6fededb3d8c90694c44214c862ac216a69ecae Mon Sep 17 00:00:00 2001
+From: Hongxu Jia <hongxu.jia@windriver.com>
+Date: Wed, 21 Aug 2019 16:50:33 +0800
+Subject: [PATCH] arm_backend
+
Upstream-Status: Pending [from debian]
+Rebase to 0.177
Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
+---
+ backends/arm_init.c | 18 ++++-
+ backends/arm_regs.c | 132 ++++++++++++++++++++++++++++++++++++
+ backends/arm_retval.c | 43 +++++++++++-
+ backends/libebl_arm.h | 9 +++
+ libelf/elf.h | 11 +++
+ tests/run-addrcfi.sh | 93 ++++++++++++++++++++++++-
+ tests/run-allregs.sh | 95 +++++++++++++++++++++++++-
+ tests/run-readelf-mixed-corenote.sh | 11 ++-
+ 8 files changed, 400 insertions(+), 12 deletions(-)
+ create mode 100644 backends/libebl_arm.h
-Index: elfutils-0.175/backends/arm_init.c
-===================================================================
---- elfutils-0.175.orig/backends/arm_init.c
-+++ elfutils-0.175/backends/arm_init.c
+diff --git a/backends/arm_init.c b/backends/arm_init.c
+index af023f0..ea2bcb7 100644
+--- a/backends/arm_init.c
++++ b/backends/arm_init.c
@@ -35,20 +35,31 @@
#define RELOC_PREFIX R_ARM_
#include "libebl_CPU.h"
@@ -36,9 +53,9 @@ Index: elfutils-0.175/backends/arm_init.c
+ }
+
/* We handle it. */
- eh->name = "ARM";
arm_init_reloc (eh);
-@@ -60,7 +71,10 @@ arm_init (Elf *elf __attribute__ ((unuse
+ HOOK (eh, segment_type_name);
+@@ -59,7 +70,10 @@ arm_init (Elf *elf __attribute__ ((unused)),
HOOK (eh, core_note);
HOOK (eh, auxv_info);
HOOK (eh, check_object_attribute);
@@ -50,10 +67,10 @@ Index: elfutils-0.175/backends/arm_init.c
HOOK (eh, abi_cfi);
HOOK (eh, check_reloc_target_type);
HOOK (eh, symbol_type_name);
-Index: elfutils-0.175/backends/arm_regs.c
-===================================================================
---- elfutils-0.175.orig/backends/arm_regs.c
-+++ elfutils-0.175/backends/arm_regs.c
+diff --git a/backends/arm_regs.c b/backends/arm_regs.c
+index a46a4c9..418c931 100644
+--- a/backends/arm_regs.c
++++ b/backends/arm_regs.c
@@ -31,6 +31,7 @@
#endif
@@ -62,7 +79,7 @@ Index: elfutils-0.175/backends/arm_regs.c
#include <dwarf.h>
#define BACKEND arm_
-@@ -76,6 +77,9 @@ arm_register_info (Ebl *ebl __attribute_
+@@ -76,6 +77,9 @@ arm_register_info (Ebl *ebl __attribute__ ((unused)),
break;
case 16 + 0 ... 16 + 7:
@@ -72,7 +89,7 @@ Index: elfutils-0.175/backends/arm_regs.c
regno += 96 - 16;
FALLTHROUGH;
case 96 + 0 ... 96 + 7:
-@@ -87,11 +91,139 @@ arm_register_info (Ebl *ebl __attribute_
+@@ -87,11 +91,139 @@ arm_register_info (Ebl *ebl __attribute__ ((unused)),
namelen = 2;
break;
@@ -212,10 +229,10 @@ Index: elfutils-0.175/backends/arm_regs.c
*setname = "VFP";
*type = DW_ATE_float;
*bits = 64;
-Index: elfutils-0.175/backends/arm_retval.c
-===================================================================
---- elfutils-0.175.orig/backends/arm_retval.c
-+++ elfutils-0.175/backends/arm_retval.c
+diff --git a/backends/arm_retval.c b/backends/arm_retval.c
+index 1c28f01..313e4eb 100644
+--- a/backends/arm_retval.c
++++ b/backends/arm_retval.c
@@ -48,6 +48,13 @@ static const Dwarf_Op loc_intreg[] =
#define nloc_intreg 1
#define nloc_intregs(n) (2 * (n))
@@ -242,7 +259,7 @@ Index: elfutils-0.175/backends/arm_retval.c
{
/* Start with the function's type, and get the DW_AT_type attribute,
which is the type of the return value. */
-@@ -98,6 +106,21 @@ arm_return_value_location (Dwarf_Die *fu
+@@ -98,6 +106,21 @@ arm_return_value_location (Dwarf_Die *functypedie, const Dwarf_Op **locp)
else
return -1;
}
@@ -264,7 +281,7 @@ Index: elfutils-0.175/backends/arm_retval.c
if (size <= 16)
{
intreg:
-@@ -106,6 +129,7 @@ arm_return_value_location (Dwarf_Die *fu
+@@ -106,6 +129,7 @@ arm_return_value_location (Dwarf_Die *functypedie, const Dwarf_Op **locp)
}
aggregate:
@@ -272,7 +289,7 @@ Index: elfutils-0.175/backends/arm_retval.c
*locp = loc_aggregate;
return nloc_aggregate;
}
-@@ -125,3 +149,18 @@ arm_return_value_location (Dwarf_Die *fu
+@@ -125,3 +149,18 @@ arm_return_value_location (Dwarf_Die *functypedie, const Dwarf_Op **locp)
DWARF and might be valid. */
return -2;
}
@@ -291,11 +308,26 @@ Index: elfutils-0.175/backends/arm_retval.c
+ return arm_return_value_location_ (functypedie, locp, 0);
+}
+
-Index: elfutils-0.175/libelf/elf.h
-===================================================================
---- elfutils-0.175.orig/libelf/elf.h
-+++ elfutils-0.175/libelf/elf.h
-@@ -2694,6 +2694,9 @@ enum
+diff --git a/backends/libebl_arm.h b/backends/libebl_arm.h
+new file mode 100644
+index 0000000..c00770c
+--- /dev/null
++++ b/backends/libebl_arm.h
+@@ -0,0 +1,9 @@
++#ifndef _LIBEBL_ARM_H
++#define _LIBEBL_ARM_H 1
++
++#include <libdw.h>
++
++extern int arm_return_value_location_soft(Dwarf_Die *, const Dwarf_Op **locp);
++extern int arm_return_value_location_hard(Dwarf_Die *, const Dwarf_Op **locp);
++
++#endif
+diff --git a/libelf/elf.h b/libelf/elf.h
+index 01648bd..05b7e7e 100644
+--- a/libelf/elf.h
++++ b/libelf/elf.h
+@@ -2690,6 +2690,9 @@ enum
#define EF_ARM_EABI_VER4 0x04000000
#define EF_ARM_EABI_VER5 0x05000000
@@ -305,7 +337,7 @@ Index: elfutils-0.175/libelf/elf.h
/* Additional symbol types for Thumb. */
#define STT_ARM_TFUNC STT_LOPROC /* A Thumb function. */
#define STT_ARM_16BIT STT_HIPROC /* A Thumb label. */
-@@ -2711,12 +2714,19 @@ enum
+@@ -2707,12 +2710,19 @@ enum
/* Processor specific values for the Phdr p_type field. */
#define PT_ARM_EXIDX (PT_LOPROC + 1) /* ARM unwind segment. */
@@ -325,7 +357,7 @@ Index: elfutils-0.175/libelf/elf.h
/* AArch64 relocs. */
-@@ -3009,6 +3019,7 @@ enum
+@@ -3005,6 +3015,7 @@ enum
TLS block (LDR, STR). */
#define R_ARM_TLS_IE12GP 111 /* 12 bit GOT entry relative
to GOT origin (LDR). */
@@ -333,24 +365,121 @@ Index: elfutils-0.175/libelf/elf.h
#define R_ARM_ME_TOO 128 /* Obsolete. */
#define R_ARM_THM_TLS_DESCSEQ 129
#define R_ARM_THM_TLS_DESCSEQ16 129
-Index: elfutils-0.175/backends/libebl_arm.h
-===================================================================
---- /dev/null
-+++ elfutils-0.175/backends/libebl_arm.h
-@@ -0,0 +1,9 @@
-+#ifndef _LIBEBL_ARM_H
-+#define _LIBEBL_ARM_H 1
-+
-+#include <libdw.h>
-+
-+extern int arm_return_value_location_soft(Dwarf_Die *, const Dwarf_Op **locp);
-+extern int arm_return_value_location_hard(Dwarf_Die *, const Dwarf_Op **locp);
-+
-+#endif
-Index: elfutils-0.175/tests/run-allregs.sh
-===================================================================
---- elfutils-0.175.orig/tests/run-allregs.sh
-+++ elfutils-0.175/tests/run-allregs.sh
+diff --git a/tests/run-addrcfi.sh b/tests/run-addrcfi.sh
+index 64fa24d..1c2aa4d 100755
+--- a/tests/run-addrcfi.sh
++++ b/tests/run-addrcfi.sh
+@@ -3554,6 +3554,38 @@ dwarf_cfi_addrframe (.eh_frame): no matching address range
+ FPA reg21 (f5): undefined
+ FPA reg22 (f6): undefined
+ FPA reg23 (f7): undefined
++ VFP reg64 (s0): undefined
++ VFP reg65 (s1): undefined
++ VFP reg66 (s2): undefined
++ VFP reg67 (s3): undefined
++ VFP reg68 (s4): undefined
++ VFP reg69 (s5): undefined
++ VFP reg70 (s6): undefined
++ VFP reg71 (s7): undefined
++ VFP reg72 (s8): undefined
++ VFP reg73 (s9): undefined
++ VFP reg74 (s10): undefined
++ VFP reg75 (s11): undefined
++ VFP reg76 (s12): undefined
++ VFP reg77 (s13): undefined
++ VFP reg78 (s14): undefined
++ VFP reg79 (s15): undefined
++ VFP reg80 (s16): undefined
++ VFP reg81 (s17): undefined
++ VFP reg82 (s18): undefined
++ VFP reg83 (s19): undefined
++ VFP reg84 (s20): undefined
++ VFP reg85 (s21): undefined
++ VFP reg86 (s22): undefined
++ VFP reg87 (s23): undefined
++ VFP reg88 (s24): undefined
++ VFP reg89 (s25): undefined
++ VFP reg90 (s26): undefined
++ VFP reg91 (s27): undefined
++ VFP reg92 (s28): undefined
++ VFP reg93 (s29): undefined
++ VFP reg94 (s30): undefined
++ VFP reg95 (s31): undefined
+ FPA reg96 (f0): undefined
+ FPA reg97 (f1): undefined
+ FPA reg98 (f2): undefined
+@@ -3562,7 +3594,66 @@ dwarf_cfi_addrframe (.eh_frame): no matching address range
+ FPA reg101 (f5): undefined
+ FPA reg102 (f6): undefined
+ FPA reg103 (f7): undefined
+- integer reg128 (spsr): undefined
++ MMX reg104 (wcgr0): undefined
++ MMX reg105 (wcgr1): undefined
++ MMX reg106 (wcgr2): undefined
++ MMX reg107 (wcgr3): undefined
++ MMX reg108 (wcgr4): undefined
++ MMX reg109 (wcgr5): undefined
++ MMX reg110 (wcgr6): undefined
++ MMX reg111 (wcgr7): undefined
++ MMX reg112 (wr0): undefined
++ MMX reg113 (wr1): undefined
++ MMX reg114 (wr2): undefined
++ MMX reg115 (wr3): undefined
++ MMX reg116 (wr4): undefined
++ MMX reg117 (wr5): undefined
++ MMX reg118 (wr6): undefined
++ MMX reg119 (wr7): undefined
++ MMX reg120 (wr8): undefined
++ MMX reg121 (wr9): undefined
++ MMX reg122 (wr10): undefined
++ MMX reg123 (wr11): undefined
++ MMX reg124 (wr12): undefined
++ MMX reg125 (wr13): undefined
++ MMX reg126 (wr14): undefined
++ MMX reg127 (wr15): undefined
++ state reg128 (spsr): undefined
++ state reg129 (spsr_fiq): undefined
++ state reg130 (spsr_irq): undefined
++ state reg131 (spsr_abt): undefined
++ state reg132 (spsr_und): undefined
++ state reg133 (spsr_svc): undefined
++ integer reg144 (r8_usr): undefined
++ integer reg145 (r9_usr): undefined
++ integer reg146 (r10_usr): undefined
++ integer reg147 (r11_usr): undefined
++ integer reg148 (r12_usr): undefined
++ integer reg149 (r13_usr): undefined
++ integer reg150 (r14_usr): undefined
++ integer reg151 (r8_fiq): undefined
++ integer reg152 (r9_fiq): undefined
++ integer reg153 (r10_fiq): undefined
++ integer reg154 (r11_fiq): undefined
++ integer reg155 (r12_fiq): undefined
++ integer reg156 (r13_fiq): undefined
++ integer reg157 (r14_fiq): undefined
++ integer reg158 (r13_irq): undefined
++ integer reg159 (r14_irq): undefined
++ integer reg160 (r13_abt): undefined
++ integer reg161 (r14_abt): undefined
++ integer reg162 (r13_und): undefined
++ integer reg163 (r14_und): undefined
++ integer reg164 (r13_svc): undefined
++ integer reg165 (r14_svc): undefined
++ MMX reg192 (wc0): undefined
++ MMX reg193 (wc1): undefined
++ MMX reg194 (wc2): undefined
++ MMX reg195 (wc3): undefined
++ MMX reg196 (wc4): undefined
++ MMX reg197 (wc5): undefined
++ MMX reg198 (wc6): undefined
++ MMX reg199 (wc7): undefined
+ VFP reg256 (d0): undefined
+ VFP reg257 (d1): undefined
+ VFP reg258 (d2): undefined
+diff --git a/tests/run-allregs.sh b/tests/run-allregs.sh
+index 1422bd6..dc0fc99 100755
+--- a/tests/run-allregs.sh
++++ b/tests/run-allregs.sh
@@ -2672,7 +2672,28 @@ integer registers:
13: sp (sp), address 32 bits
14: lr (lr), address 32 bits
@@ -468,11 +597,11 @@ Index: elfutils-0.175/tests/run-allregs.sh
EOF
# See run-readelf-mixed-corenote.sh for instructions to regenerate
-Index: elfutils-0.175/tests/run-readelf-mixed-corenote.sh
-===================================================================
---- elfutils-0.175.orig/tests/run-readelf-mixed-corenote.sh
-+++ elfutils-0.175/tests/run-readelf-mixed-corenote.sh
-@@ -31,12 +31,11 @@ Note segment of 892 bytes at offset 0x27
+diff --git a/tests/run-readelf-mixed-corenote.sh b/tests/run-readelf-mixed-corenote.sh
+index c960f1d..e4bf074 100755
+--- a/tests/run-readelf-mixed-corenote.sh
++++ b/tests/run-readelf-mixed-corenote.sh
+@@ -31,12 +31,11 @@ Note segment of 892 bytes at offset 0x274:
pid: 11087, ppid: 11063, pgrp: 11087, sid: 11063
utime: 0.000000, stime: 0.010000, cutime: 0.000000, cstime: 0.000000
orig_r0: -1, fpvalid: 1
@@ -490,114 +619,6 @@ Index: elfutils-0.175/tests/run-readelf-mixed-corenote.sh
CORE 124 PRPSINFO
state: 0, sname: R, zomb: 0, nice: 0, flag: 0x00400500
uid: 0, gid: 0, pid: 11087, ppid: 11063, pgrp: 11087, sid: 11063
-Index: elfutils-0.175/tests/run-addrcfi.sh
-===================================================================
---- elfutils-0.175.orig/tests/run-addrcfi.sh
-+++ elfutils-0.175/tests/run-addrcfi.sh
-@@ -3554,6 +3554,38 @@ dwarf_cfi_addrframe (.eh_frame): no matc
- FPA reg21 (f5): undefined
- FPA reg22 (f6): undefined
- FPA reg23 (f7): undefined
-+ VFP reg64 (s0): undefined
-+ VFP reg65 (s1): undefined
-+ VFP reg66 (s2): undefined
-+ VFP reg67 (s3): undefined
-+ VFP reg68 (s4): undefined
-+ VFP reg69 (s5): undefined
-+ VFP reg70 (s6): undefined
-+ VFP reg71 (s7): undefined
-+ VFP reg72 (s8): undefined
-+ VFP reg73 (s9): undefined
-+ VFP reg74 (s10): undefined
-+ VFP reg75 (s11): undefined
-+ VFP reg76 (s12): undefined
-+ VFP reg77 (s13): undefined
-+ VFP reg78 (s14): undefined
-+ VFP reg79 (s15): undefined
-+ VFP reg80 (s16): undefined
-+ VFP reg81 (s17): undefined
-+ VFP reg82 (s18): undefined
-+ VFP reg83 (s19): undefined
-+ VFP reg84 (s20): undefined
-+ VFP reg85 (s21): undefined
-+ VFP reg86 (s22): undefined
-+ VFP reg87 (s23): undefined
-+ VFP reg88 (s24): undefined
-+ VFP reg89 (s25): undefined
-+ VFP reg90 (s26): undefined
-+ VFP reg91 (s27): undefined
-+ VFP reg92 (s28): undefined
-+ VFP reg93 (s29): undefined
-+ VFP reg94 (s30): undefined
-+ VFP reg95 (s31): undefined
- FPA reg96 (f0): undefined
- FPA reg97 (f1): undefined
- FPA reg98 (f2): undefined
-@@ -3562,7 +3594,66 @@ dwarf_cfi_addrframe (.eh_frame): no matc
- FPA reg101 (f5): undefined
- FPA reg102 (f6): undefined
- FPA reg103 (f7): undefined
-- integer reg128 (spsr): undefined
-+ MMX reg104 (wcgr0): undefined
-+ MMX reg105 (wcgr1): undefined
-+ MMX reg106 (wcgr2): undefined
-+ MMX reg107 (wcgr3): undefined
-+ MMX reg108 (wcgr4): undefined
-+ MMX reg109 (wcgr5): undefined
-+ MMX reg110 (wcgr6): undefined
-+ MMX reg111 (wcgr7): undefined
-+ MMX reg112 (wr0): undefined
-+ MMX reg113 (wr1): undefined
-+ MMX reg114 (wr2): undefined
-+ MMX reg115 (wr3): undefined
-+ MMX reg116 (wr4): undefined
-+ MMX reg117 (wr5): undefined
-+ MMX reg118 (wr6): undefined
-+ MMX reg119 (wr7): undefined
-+ MMX reg120 (wr8): undefined
-+ MMX reg121 (wr9): undefined
-+ MMX reg122 (wr10): undefined
-+ MMX reg123 (wr11): undefined
-+ MMX reg124 (wr12): undefined
-+ MMX reg125 (wr13): undefined
-+ MMX reg126 (wr14): undefined
-+ MMX reg127 (wr15): undefined
-+ state reg128 (spsr): undefined
-+ state reg129 (spsr_fiq): undefined
-+ state reg130 (spsr_irq): undefined
-+ state reg131 (spsr_abt): undefined
-+ state reg132 (spsr_und): undefined
-+ state reg133 (spsr_svc): undefined
-+ integer reg144 (r8_usr): undefined
-+ integer reg145 (r9_usr): undefined
-+ integer reg146 (r10_usr): undefined
-+ integer reg147 (r11_usr): undefined
-+ integer reg148 (r12_usr): undefined
-+ integer reg149 (r13_usr): undefined
-+ integer reg150 (r14_usr): undefined
-+ integer reg151 (r8_fiq): undefined
-+ integer reg152 (r9_fiq): undefined
-+ integer reg153 (r10_fiq): undefined
-+ integer reg154 (r11_fiq): undefined
-+ integer reg155 (r12_fiq): undefined
-+ integer reg156 (r13_fiq): undefined
-+ integer reg157 (r14_fiq): undefined
-+ integer reg158 (r13_irq): undefined
-+ integer reg159 (r14_irq): undefined
-+ integer reg160 (r13_abt): undefined
-+ integer reg161 (r14_abt): undefined
-+ integer reg162 (r13_und): undefined
-+ integer reg163 (r14_und): undefined
-+ integer reg164 (r13_svc): undefined
-+ integer reg165 (r14_svc): undefined
-+ MMX reg192 (wc0): undefined
-+ MMX reg193 (wc1): undefined
-+ MMX reg194 (wc2): undefined
-+ MMX reg195 (wc3): undefined
-+ MMX reg196 (wc4): undefined
-+ MMX reg197 (wc5): undefined
-+ MMX reg198 (wc6): undefined
-+ MMX reg199 (wc7): undefined
- VFP reg256 (d0): undefined
- VFP reg257 (d1): undefined
- VFP reg258 (d2): undefined
+--
+2.7.4
+
diff --git a/external/poky/meta/recipes-devtools/elfutils/files/debian/disable_werror.patch b/external/poky/meta/recipes-devtools/elfutils/files/debian/disable_werror.patch
index 75736bff..bd98dae4 100644
--- a/external/poky/meta/recipes-devtools/elfutils/files/debian/disable_werror.patch
+++ b/external/poky/meta/recipes-devtools/elfutils/files/debian/disable_werror.patch
@@ -6,12 +6,12 @@ Last-Update: 2018-01-01
Upstream-Status: Pending [from debian]
Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
-Index: elfutils-0.175/config/eu.am
+Index: elfutils-0.176/config/eu.am
===================================================================
---- elfutils-0.175.orig/config/eu.am
-+++ elfutils-0.175/config/eu.am
+--- elfutils-0.176.orig/config/eu.am
++++ elfutils-0.176/config/eu.am
@@ -73,7 +73,6 @@ AM_CFLAGS = -std=gnu99 -Wall -Wshadow -W
- -Wold-style-definition -Wstrict-prototypes \
+ -Wold-style-definition -Wstrict-prototypes -Wtrampolines \
$(LOGICAL_OP_WARNING) $(DUPLICATED_COND_WARNING) \
$(NULL_DEREFERENCE_WARNING) $(IMPLICIT_FALLTHROUGH_WARNING) \
- $(if $($(*F)_no_Werror),,-Werror) \
diff --git a/external/poky/meta/recipes-devtools/elfutils/files/debian/hppa_backend.diff b/external/poky/meta/recipes-devtools/elfutils/files/debian/hppa_backend.diff
index 105e3f43..53fa2f43 100644
--- a/external/poky/meta/recipes-devtools/elfutils/files/debian/hppa_backend.diff
+++ b/external/poky/meta/recipes-devtools/elfutils/files/debian/hppa_backend.diff
@@ -1,10 +1,74 @@
+From ffb811e18d7046d5bbe54ede5b1b7e14eaac0146 Mon Sep 17 00:00:00 2001
+From: Hongxu Jia <hongxu.jia@windriver.com>
+Date: Wed, 21 Aug 2019 15:44:18 +0800
+Subject: [PATCH] hppa backend
+
+Rebase to 0.177
Upstream-Status: Pending [from debian]
Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
-Index: elfutils-0.175/backends/parisc_init.c
-===================================================================
+---
+ backends/Makefile.am | 7 +-
+ backends/libebl_parisc.h | 9 ++
+ backends/parisc_init.c | 73 +++++++++++++
+ backends/parisc_regs.c | 159 ++++++++++++++++++++++++++++
+ backends/parisc_reloc.def | 128 +++++++++++++++++++++++
+ backends/parisc_retval.c | 213 ++++++++++++++++++++++++++++++++++++++
+ backends/parisc_symbol.c | 113 ++++++++++++++++++++
+ libelf/elf.h | 11 ++
+ 8 files changed, 711 insertions(+), 2 deletions(-)
+ create mode 100644 backends/libebl_parisc.h
+ create mode 100644 backends/parisc_init.c
+ create mode 100644 backends/parisc_regs.c
+ create mode 100644 backends/parisc_reloc.def
+ create mode 100644 backends/parisc_retval.c
+ create mode 100644 backends/parisc_symbol.c
+
+diff --git a/backends/Makefile.am b/backends/Makefile.am
+index f405212..4755f61 100644
+--- a/backends/Makefile.am
++++ b/backends/Makefile.am
+@@ -37,7 +37,9 @@ AM_CPPFLAGS += -I$(top_srcdir)/libebl -I$(top_srcdir)/libasm \
+ noinst_LIBRARIES = libebl_backends.a libebl_backends_pic.a
+
+ modules = i386 sh x86_64 ia64 alpha arm aarch64 sparc ppc ppc64 s390 \
+- tilegx m68k bpf riscv csky
++ tilegx m68k bpf riscv csky parisc
++
++parisc_SRCS = parisc_init.c parisc_symbol.c parisc_regs.c parisc_retval.c
+
+ i386_SRCS = i386_init.c i386_symbol.c i386_corenote.c i386_cfi.c \
+ i386_retval.c i386_regs.c i386_auxv.c i386_syscall.c \
+@@ -102,7 +104,8 @@ libebl_backends_a_SOURCES = $(i386_SRCS) $(sh_SRCS) $(x86_64_SRCS) \
+ $(ia64_SRCS) $(alpha_SRCS) $(arm_SRCS) \
+ $(aarch64_SRCS) $(sparc_SRCS) $(ppc_SRCS) \
+ $(ppc64_SRCS) $(s390_SRCS) $(tilegx_SRCS) \
+- $(m68k_SRCS) $(bpf_SRCS) $(riscv_SRCS) $(csky_SRCS)
++ $(m68k_SRCS) $(bpf_SRCS) $(riscv_SRCS) $(csky_SRCS) \
++ $(parisc_SRCS)
+
+ libebl_backends_pic_a_SOURCES =
+ am_libebl_backends_pic_a_OBJECTS = $(libebl_backends_a_SOURCES:.c=.os)
+diff --git a/backends/libebl_parisc.h b/backends/libebl_parisc.h
+new file mode 100644
+index 0000000..f473b79
+--- /dev/null
++++ b/backends/libebl_parisc.h
+@@ -0,0 +1,9 @@
++#ifndef _LIBEBL_HPPA_H
++#define _LIBEBL_HPPA_H 1
++
++#include <libdw.h>
++
++extern int parisc_return_value_location_32(Dwarf_Die *, const Dwarf_Op **locp);
++extern int parisc_return_value_location_64(Dwarf_Die *, const Dwarf_Op **locp);
++
++#endif
+diff --git a/backends/parisc_init.c b/backends/parisc_init.c
+new file mode 100644
+index 0000000..f1e401c
--- /dev/null
-+++ elfutils-0.175/backends/parisc_init.c
++++ b/backends/parisc_init.c
@@ -0,0 +1,73 @@
+/* Initialization of PA-RISC specific backend library.
+ Copyright (C) 2002, 2005, 2006 Red Hat, Inc.
@@ -79,10 +143,11 @@ Index: elfutils-0.175/backends/parisc_init.c
+
+ return MODVERSION;
+}
-Index: elfutils-0.175/backends/parisc_regs.c
-===================================================================
+diff --git a/backends/parisc_regs.c b/backends/parisc_regs.c
+new file mode 100644
+index 0000000..3895f8e
--- /dev/null
-+++ elfutils-0.175/backends/parisc_regs.c
++++ b/backends/parisc_regs.c
@@ -0,0 +1,159 @@
+/* Register names and numbers for PA-RISC DWARF.
+ Copyright (C) 2005, 2006 Red Hat, Inc.
@@ -243,10 +308,11 @@ Index: elfutils-0.175/backends/parisc_regs.c
+ name[namelen++] = '\0';
+ return namelen;
+}
-Index: elfutils-0.175/backends/parisc_reloc.def
-===================================================================
+diff --git a/backends/parisc_reloc.def b/backends/parisc_reloc.def
+new file mode 100644
+index 0000000..1f875ba
--- /dev/null
-+++ elfutils-0.175/backends/parisc_reloc.def
++++ b/backends/parisc_reloc.def
@@ -0,0 +1,128 @@
+/* List the relocation types for PA-RISC. -*- C -*-
+ Copyright (C) 2005 Red Hat, Inc.
@@ -376,10 +442,11 @@ Index: elfutils-0.175/backends/parisc_reloc.def
+RELOC_TYPE (TLS_DTPMOD64, DYN)
+
+#define NO_RELATIVE_RELOC 1
-Index: elfutils-0.175/backends/parisc_retval.c
-===================================================================
+diff --git a/backends/parisc_retval.c b/backends/parisc_retval.c
+new file mode 100644
+index 0000000..df7ec3a
--- /dev/null
-+++ elfutils-0.175/backends/parisc_retval.c
++++ b/backends/parisc_retval.c
@@ -0,0 +1,213 @@
+/* Function return value location for Linux/PA-RISC ABI.
+ Copyright (C) 2005 Red Hat, Inc.
@@ -594,10 +661,11 @@ Index: elfutils-0.175/backends/parisc_retval.c
+ return parisc_return_value_location_ (functypedie, locp, 1);
+}
+
-Index: elfutils-0.175/backends/parisc_symbol.c
-===================================================================
+diff --git a/backends/parisc_symbol.c b/backends/parisc_symbol.c
+new file mode 100644
+index 0000000..5754bd8
--- /dev/null
-+++ elfutils-0.175/backends/parisc_symbol.c
++++ b/backends/parisc_symbol.c
@@ -0,0 +1,113 @@
+/* PA-RISC specific symbolic name handling.
+ Copyright (C) 2002, 2005 Red Hat, Inc.
@@ -712,55 +780,11 @@ Index: elfutils-0.175/backends/parisc_symbol.c
+ return ELF_T_NUM;
+ }
+}
-Index: elfutils-0.175/backends/libebl_parisc.h
-===================================================================
---- /dev/null
-+++ elfutils-0.175/backends/libebl_parisc.h
-@@ -0,0 +1,9 @@
-+#ifndef _LIBEBL_HPPA_H
-+#define _LIBEBL_HPPA_H 1
-+
-+#include <libdw.h>
-+
-+extern int parisc_return_value_location_32(Dwarf_Die *, const Dwarf_Op **locp);
-+extern int parisc_return_value_location_64(Dwarf_Die *, const Dwarf_Op **locp);
-+
-+#endif
-Index: elfutils-0.175/backends/Makefile.am
-===================================================================
---- elfutils-0.175.orig/backends/Makefile.am
-+++ elfutils-0.175/backends/Makefile.am
-@@ -33,12 +33,13 @@ AM_CPPFLAGS += -I$(top_srcdir)/libebl -I
-
-
- modules = i386 sh x86_64 ia64 alpha arm aarch64 sparc ppc ppc64 s390 \
-- tilegx m68k bpf riscv
-+ tilegx m68k bpf riscv parisc
- libebl_pic = libebl_i386_pic.a libebl_sh_pic.a libebl_x86_64_pic.a \
- libebl_ia64_pic.a libebl_alpha_pic.a libebl_arm_pic.a \
- libebl_aarch64_pic.a libebl_sparc_pic.a libebl_ppc_pic.a \
- libebl_ppc64_pic.a libebl_s390_pic.a libebl_tilegx_pic.a \
-- libebl_m68k_pic.a libebl_bpf_pic.a libebl_riscv_pic.a
-+ libebl_m68k_pic.a libebl_bpf_pic.a libebl_riscv_pic.a \
-+ libebl_parisc_pic.a
- noinst_LIBRARIES = $(libebl_pic)
- noinst_DATA = $(libebl_pic:_pic.a=.so)
-
-@@ -136,6 +137,9 @@ riscv_SRCS = riscv_init.c riscv_symbol.c
- libebl_riscv_pic_a_SOURCES = $(riscv_SRCS)
- am_libebl_riscv_pic_a_OBJECTS = $(riscv_SRCS:.c=.os)
-
-+parisc_SRCS = parisc_init.c parisc_symbol.c parisc_regs.c parisc_retval.c
-+libebl_parisc_pic_a_SOURCES = $(parisc_SRCS)
-+am_libebl_parisc_pic_a_OBJECTS = $(parisc_SRCS:.c=.os)
-
- libebl_%.so libebl_%.map: libebl_%_pic.a $(libelf) $(libdw) $(libeu)
- @rm -f $(@:.so=.map)
-Index: elfutils-0.175/libelf/elf.h
-===================================================================
---- elfutils-0.175.orig/libelf/elf.h
-+++ elfutils-0.175/libelf/elf.h
-@@ -2155,16 +2155,24 @@ enum
+diff --git a/libelf/elf.h b/libelf/elf.h
+index 01648bd..218ceb2 100644
+--- a/libelf/elf.h
++++ b/libelf/elf.h
+@@ -2162,16 +2162,24 @@ enum
#define R_PARISC_PCREL17F 12 /* 17 bits of rel. address. */
#define R_PARISC_PCREL14R 14 /* Right 14 bits of rel. address. */
#define R_PARISC_DPREL21L 18 /* Left 21 bits of rel. address. */
@@ -785,7 +809,7 @@ Index: elfutils-0.175/libelf/elf.h
#define R_PARISC_LTOFF_FPTR32 57 /* 32 bits LT-rel. function pointer. */
#define R_PARISC_LTOFF_FPTR21L 58 /* LT-rel. fct ptr, left 21 bits. */
#define R_PARISC_LTOFF_FPTR14R 62 /* LT-rel. fct ptr, right 14 bits. */
-@@ -2173,6 +2181,7 @@ enum
+@@ -2180,6 +2188,7 @@ enum
#define R_PARISC_PLABEL21L 66 /* Left 21 bits of fdesc address. */
#define R_PARISC_PLABEL14R 70 /* Right 14 bits of fdesc address. */
#define R_PARISC_PCREL64 72 /* 64 bits PC-rel. address. */
@@ -793,7 +817,7 @@ Index: elfutils-0.175/libelf/elf.h
#define R_PARISC_PCREL22F 74 /* 22 bits PC-rel. address. */
#define R_PARISC_PCREL14WR 75 /* PC-rel. address, right 14 bits. */
#define R_PARISC_PCREL14DR 76 /* PC rel. address, right 14 bits. */
-@@ -2198,6 +2207,8 @@ enum
+@@ -2205,6 +2214,8 @@ enum
#define R_PARISC_LTOFF16WF 102 /* 16 bits LT-rel. address. */
#define R_PARISC_LTOFF16DF 103 /* 16 bits LT-rel. address. */
#define R_PARISC_SECREL64 104 /* 64 bits section rel. address. */
diff --git a/external/poky/meta/recipes-devtools/elfutils/files/debian/hurd_path.patch b/external/poky/meta/recipes-devtools/elfutils/files/debian/hurd_path.patch
index 8fa35a45..62a960f3 100644
--- a/external/poky/meta/recipes-devtools/elfutils/files/debian/hurd_path.patch
+++ b/external/poky/meta/recipes-devtools/elfutils/files/debian/hurd_path.patch
@@ -1,5 +1,6 @@
Upstream-Status: Pending [from debian]
Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
+
Index: elfutils-0.165/tests/run-native-test.sh
===================================================================
--- elfutils-0.165.orig/tests/run-native-test.sh
diff --git a/external/poky/meta/recipes-devtools/elfutils/files/debian/kfreebsd_path.patch b/external/poky/meta/recipes-devtools/elfutils/files/debian/kfreebsd_path.patch
index fe5159f3..e85a2fed 100644
--- a/external/poky/meta/recipes-devtools/elfutils/files/debian/kfreebsd_path.patch
+++ b/external/poky/meta/recipes-devtools/elfutils/files/debian/kfreebsd_path.patch
@@ -1,5 +1,6 @@
Upstream-Status: Pending [from debian]
Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
+
Index: b/tests/run-native-test.sh
===================================================================
--- a/tests/run-native-test.sh
diff --git a/external/poky/meta/recipes-devtools/elfutils/files/debian/mips_backend.diff b/external/poky/meta/recipes-devtools/elfutils/files/debian/mips_backend.diff
index 998fa04d..749faa40 100644
--- a/external/poky/meta/recipes-devtools/elfutils/files/debian/mips_backend.diff
+++ b/external/poky/meta/recipes-devtools/elfutils/files/debian/mips_backend.diff
@@ -1,9 +1,62 @@
+From 7e0b036d087dfff7f5e306f52fc78745f99454c3 Mon Sep 17 00:00:00 2001
+From: Hongxu Jia <hongxu.jia@windriver.com>
+Date: Wed, 21 Aug 2019 15:49:52 +0800
+Subject: [PATCH] mips backend
+
+Rebase to 0.177
Upstream-Status: Pending [from debian]
+
Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
-Index: elfutils-0.175/backends/mips_init.c
-===================================================================
+
+---
+ backends/Makefile.am | 6 +-
+ backends/mips_init.c | 59 ++++++++
+ backends/mips_regs.c | 104 +++++++++++++
+ backends/mips_reloc.def | 79 ++++++++++
+ backends/mips_retval.c | 321 ++++++++++++++++++++++++++++++++++++++++
+ backends/mips_symbol.c | 53 +++++++
+ libebl/eblopenbackend.c | 3 +
+ 7 files changed, 623 insertions(+), 2 deletions(-)
+ create mode 100644 backends/mips_init.c
+ create mode 100644 backends/mips_regs.c
+ create mode 100644 backends/mips_reloc.def
+ create mode 100644 backends/mips_retval.c
+ create mode 100644 backends/mips_symbol.c
+
+diff --git a/backends/Makefile.am b/backends/Makefile.am
+index 4755f61..07d45d7 100644
+--- a/backends/Makefile.am
++++ b/backends/Makefile.am
+@@ -37,7 +37,7 @@ AM_CPPFLAGS += -I$(top_srcdir)/libebl -I$(top_srcdir)/libasm \
+ noinst_LIBRARIES = libebl_backends.a libebl_backends_pic.a
+
+ modules = i386 sh x86_64 ia64 alpha arm aarch64 sparc ppc ppc64 s390 \
+- tilegx m68k bpf riscv csky parisc
++ tilegx m68k bpf riscv csky parisc mips
+
+ parisc_SRCS = parisc_init.c parisc_symbol.c parisc_regs.c parisc_retval.c
+
+@@ -100,12 +100,14 @@ riscv_SRCS = riscv_init.c riscv_symbol.c riscv_cfi.c riscv_regs.c \
+ csky_SRCS = csky_attrs.c csky_init.c csky_symbol.c csky_cfi.c \
+ csky_regs.c csky_initreg.c csky_corenote.c
+
++mips_SRCS = mips_init.c mips_symbol.c mips_regs.c mips_retval.c
++
+ libebl_backends_a_SOURCES = $(i386_SRCS) $(sh_SRCS) $(x86_64_SRCS) \
+ $(ia64_SRCS) $(alpha_SRCS) $(arm_SRCS) \
+ $(aarch64_SRCS) $(sparc_SRCS) $(ppc_SRCS) \
+ $(ppc64_SRCS) $(s390_SRCS) $(tilegx_SRCS) \
+ $(m68k_SRCS) $(bpf_SRCS) $(riscv_SRCS) $(csky_SRCS) \
+- $(parisc_SRCS)
++ $(parisc_SRCS) $(mips_SRCS)
+
+ libebl_backends_pic_a_SOURCES =
+ am_libebl_backends_pic_a_OBJECTS = $(libebl_backends_a_SOURCES:.c=.os)
+diff --git a/backends/mips_init.c b/backends/mips_init.c
+new file mode 100644
+index 0000000..975c04e
--- /dev/null
-+++ elfutils-0.175/backends/mips_init.c
++++ b/backends/mips_init.c
@@ -0,0 +1,59 @@
+/* Initialization of mips specific backend library.
+ Copyright (C) 2006 Red Hat, Inc.
@@ -64,10 +117,11 @@ Index: elfutils-0.175/backends/mips_init.c
+
+ return MODVERSION;
+}
-Index: elfutils-0.175/backends/mips_regs.c
-===================================================================
+diff --git a/backends/mips_regs.c b/backends/mips_regs.c
+new file mode 100644
+index 0000000..44f86cb
--- /dev/null
-+++ elfutils-0.175/backends/mips_regs.c
++++ b/backends/mips_regs.c
@@ -0,0 +1,104 @@
+/* Register names and numbers for MIPS DWARF.
+ Copyright (C) 2006 Red Hat, Inc.
@@ -173,10 +227,11 @@ Index: elfutils-0.175/backends/mips_regs.c
+ name[namelen++] = '\0';
+ return namelen;
+}
-Index: elfutils-0.175/backends/mips_reloc.def
-===================================================================
+diff --git a/backends/mips_reloc.def b/backends/mips_reloc.def
+new file mode 100644
+index 0000000..4579970
--- /dev/null
-+++ elfutils-0.175/backends/mips_reloc.def
++++ b/backends/mips_reloc.def
@@ -0,0 +1,79 @@
+/* List the relocation types for mips. -*- C -*-
+ Copyright (C) 2006 Red Hat, Inc.
@@ -257,10 +312,11 @@ Index: elfutils-0.175/backends/mips_reloc.def
+
+#define NO_COPY_RELOC 1
+#define NO_RELATIVE_RELOC 1
-Index: elfutils-0.175/backends/mips_retval.c
-===================================================================
+diff --git a/backends/mips_retval.c b/backends/mips_retval.c
+new file mode 100644
+index 0000000..656cd1f
--- /dev/null
-+++ elfutils-0.175/backends/mips_retval.c
++++ b/backends/mips_retval.c
@@ -0,0 +1,321 @@
+/* Function return value location for Linux/mips ABI.
+ Copyright (C) 2005 Red Hat, Inc.
@@ -583,10 +639,11 @@ Index: elfutils-0.175/backends/mips_retval.c
+ DWARF and might be valid. */
+ return -2;
+}
-Index: elfutils-0.175/backends/mips_symbol.c
-===================================================================
+diff --git a/backends/mips_symbol.c b/backends/mips_symbol.c
+new file mode 100644
+index 0000000..261b05d
--- /dev/null
-+++ elfutils-0.175/backends/mips_symbol.c
++++ b/backends/mips_symbol.c
@@ -0,0 +1,53 @@
+/* MIPS specific symbolic name handling.
+ Copyright (C) 2002, 2003, 2005 Red Hat, Inc.
@@ -641,47 +698,27 @@ Index: elfutils-0.175/backends/mips_symbol.c
+ return ELF_T_NUM;
+ }
+}
-Index: elfutils-0.175/libebl/eblopenbackend.c
-===================================================================
---- elfutils-0.175.orig/libebl/eblopenbackend.c
-+++ elfutils-0.175/libebl/eblopenbackend.c
-@@ -71,6 +71,8 @@ static const struct
- { "sparc", "elf_sparc", "sparc", 5, EM_SPARC, 0, 0 },
- { "sparc", "elf_sparcv8plus", "sparc", 5, EM_SPARC32PLUS, 0, 0 },
- { "s390", "ebl_s390", "s390", 4, EM_S390, 0, 0 },
-+ { "mips", "elf_mips", "mips", 4, EM_MIPS, 0, 0 },
-+ { "mips", "elf_mipsel", "mipsel", 4, EM_MIPS_RS3_LE, 0, 0 },
-
- { "m32", "elf_m32", "m32", 3, EM_M32, 0, 0 },
- { "m68k", "elf_m68k", "m68k", 4, EM_68K, ELFCLASS32, ELFDATA2MSB },
-Index: elfutils-0.175/backends/Makefile.am
-===================================================================
---- elfutils-0.175.orig/backends/Makefile.am
-+++ elfutils-0.175/backends/Makefile.am
-@@ -33,13 +33,13 @@ AM_CPPFLAGS += -I$(top_srcdir)/libebl -I
+diff --git a/libebl/eblopenbackend.c b/libebl/eblopenbackend.c
+index 210b47e..1feac13 100644
+--- a/libebl/eblopenbackend.c
++++ b/libebl/eblopenbackend.c
+@@ -57,6 +57,7 @@ const char *m68k_init (Elf *, GElf_Half, Ebl *, size_t);
+ const char *bpf_init (Elf *, GElf_Half, Ebl *, size_t);
+ const char *riscv_init (Elf *, GElf_Half, Ebl *, size_t);
+ const char *csky_init (Elf *, GElf_Half, Ebl *, size_t);
++const char *mips_init (Elf *, GElf_Half, Ebl *, size_t);
+ /* This table should contain the complete list of architectures as far
+ as the ELF specification is concerned. */
+@@ -87,6 +88,8 @@ static const struct
+ { sparc_init, "elf_sparc", "sparc", 5, EM_SPARC, 0, 0 },
+ { sparc_init, "elf_sparcv8plus", "sparc", 5, EM_SPARC32PLUS, 0, 0 },
+ { s390_init, "ebl_s390", "s390", 4, EM_S390, 0, 0 },
++ { mips_init, "elf_mips", "mips", 4, EM_MIPS, 0, 0 },
++ { mips_init, "elf_mipsel", "mipsel", 4, EM_MIPS_RS3_LE, 0, 0 },
- modules = i386 sh x86_64 ia64 alpha arm aarch64 sparc ppc ppc64 s390 \
-- tilegx m68k bpf riscv parisc
-+ tilegx m68k bpf riscv parisc mips
- libebl_pic = libebl_i386_pic.a libebl_sh_pic.a libebl_x86_64_pic.a \
- libebl_ia64_pic.a libebl_alpha_pic.a libebl_arm_pic.a \
- libebl_aarch64_pic.a libebl_sparc_pic.a libebl_ppc_pic.a \
- libebl_ppc64_pic.a libebl_s390_pic.a libebl_tilegx_pic.a \
- libebl_m68k_pic.a libebl_bpf_pic.a libebl_riscv_pic.a \
-- libebl_parisc_pic.a
-+ libebl_parisc_pic.a libebl_mips_pic.a
- noinst_LIBRARIES = $(libebl_pic)
- noinst_DATA = $(libebl_pic:_pic.a=.so)
-
-@@ -141,6 +141,10 @@ parisc_SRCS = parisc_init.c parisc_symbo
- libebl_parisc_pic_a_SOURCES = $(parisc_SRCS)
- am_libebl_parisc_pic_a_OBJECTS = $(parisc_SRCS:.c=.os)
-
-+mips_SRCS = mips_init.c mips_symbol.c mips_regs.c mips_retval.c
-+libebl_mips_pic_a_SOURCES = $(mips_SRCS)
-+am_libebl_mips_pic_a_OBJECTS = $(mips_SRCS:.c=.os)
-+
- libebl_%.so libebl_%.map: libebl_%_pic.a $(libelf) $(libdw) $(libeu)
- @rm -f $(@:.so=.map)
- $(AM_V_at)echo 'ELFUTILS_$(PACKAGE_VERSION) { global: $*_init; local: *; };' \
+ { NULL, "elf_m32", "m32", 3, EM_M32, 0, 0 },
+ { m68k_init, "elf_m68k", "m68k", 4, EM_68K, ELFCLASS32, ELFDATA2MSB },
+--
+2.17.1
+
diff --git a/external/poky/meta/recipes-devtools/elfutils/files/debian/mips_cfi.patch b/external/poky/meta/recipes-devtools/elfutils/files/debian/mips_cfi.patch
new file mode 100644
index 00000000..dd8f88a4
--- /dev/null
+++ b/external/poky/meta/recipes-devtools/elfutils/files/debian/mips_cfi.patch
@@ -0,0 +1,129 @@
+From 5bf6117a6eaf9007ce80adbb8b66a95ca98047a4 Mon Sep 17 00:00:00 2001
+From: Hongxu Jia <hongxu.jia@windriver.com>
+Date: Wed, 21 Aug 2019 17:00:30 +0800
+Subject: [PATCH] mips_cfi
+
+Upstream-Status: Pending [from debian]
+
+Rebase to 0.177
+
+Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
+
+---
+ backends/Makefile.am | 2 +-
+ backends/mips_cfi.c | 80 ++++++++++++++++++++++++++++++++++++++++++++
+ backends/mips_init.c | 1 +
+ 3 files changed, 82 insertions(+), 1 deletion(-)
+ create mode 100644 backends/mips_cfi.c
+
+diff --git a/backends/Makefile.am b/backends/Makefile.am
+index 07d45d7..dec3080 100644
+--- a/backends/Makefile.am
++++ b/backends/Makefile.am
+@@ -100,7 +100,7 @@ riscv_SRCS = riscv_init.c riscv_symbol.c riscv_cfi.c riscv_regs.c \
+ csky_SRCS = csky_attrs.c csky_init.c csky_symbol.c csky_cfi.c \
+ csky_regs.c csky_initreg.c csky_corenote.c
+
+-mips_SRCS = mips_init.c mips_symbol.c mips_regs.c mips_retval.c
++mips_SRCS = mips_init.c mips_symbol.c mips_regs.c mips_retval.c mips_cfi.c
+
+ libebl_backends_a_SOURCES = $(i386_SRCS) $(sh_SRCS) $(x86_64_SRCS) \
+ $(ia64_SRCS) $(alpha_SRCS) $(arm_SRCS) \
+diff --git a/backends/mips_cfi.c b/backends/mips_cfi.c
+new file mode 100644
+index 0000000..9ffdab5
+--- /dev/null
++++ b/backends/mips_cfi.c
+@@ -0,0 +1,80 @@
++/* MIPS ABI-specified defaults for DWARF CFI.
++ Copyright (C) 2018 Kurt Roeckx, Inc.
++ This file is part of elfutils.
++
++ This file is free software; you can redistribute it and/or modify
++ it under the terms of either
++
++ * the GNU Lesser General Public License as published by the Free
++ Software Foundation; either version 3 of the License, or (at
++ your option) any later version
++
++ or
++
++ * the GNU General Public License as published by the Free
++ Software Foundation; either version 2 of the License, or (at
++ your option) any later version
++
++ or both in parallel, as here.
++
++ elfutils is distributed in the hope that it will be useful, but
++ WITHOUT ANY WARRANTY; without even the implied warranty of
++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
++ General Public License for more details.
++
++ You should have received copies of the GNU General Public License and
++ the GNU Lesser General Public License along with this program. If
++ not, see <http://www.gnu.org/licenses/>. */
++
++#ifdef HAVE_CONFIG_H
++# include <config.h>
++#endif
++
++#include <dwarf.h>
++
++#define BACKEND mips_
++#include "libebl_CPU.h"
++
++int
++mips_abi_cfi (Ebl *ebl __attribute__ ((unused)), Dwarf_CIE *abi_info)
++{
++ static const uint8_t abi_cfi[] =
++ {
++ /* Call-saved regs. */
++ DW_CFA_same_value, ULEB128_7 (16), /* $16 */
++ DW_CFA_same_value, ULEB128_7 (17), /* $17 */
++ DW_CFA_same_value, ULEB128_7 (18), /* $18 */
++ DW_CFA_same_value, ULEB128_7 (19), /* $19 */
++ DW_CFA_same_value, ULEB128_7 (20), /* $20 */
++ DW_CFA_same_value, ULEB128_7 (21), /* $21 */
++ DW_CFA_same_value, ULEB128_7 (22), /* $22 */
++ DW_CFA_same_value, ULEB128_7 (23), /* $23 */
++ DW_CFA_same_value, ULEB128_7 (28), /* $28 */
++ DW_CFA_same_value, ULEB128_7 (29), /* $29 */
++ DW_CFA_same_value, ULEB128_7 (30), /* $30 */
++
++ DW_CFA_same_value, ULEB128_7 (52), /* $f20 */
++ DW_CFA_same_value, ULEB128_7 (53), /* $f21 */
++ DW_CFA_same_value, ULEB128_7 (54), /* $f22 */
++ DW_CFA_same_value, ULEB128_7 (55), /* $f23 */
++ DW_CFA_same_value, ULEB128_7 (56), /* $f24 */
++ DW_CFA_same_value, ULEB128_7 (57), /* $f25 */
++ DW_CFA_same_value, ULEB128_7 (58), /* $f26 */
++ DW_CFA_same_value, ULEB128_7 (59), /* $f27 */
++ DW_CFA_same_value, ULEB128_7 (60), /* $f28 */
++ DW_CFA_same_value, ULEB128_7 (61), /* $f29 */
++ DW_CFA_same_value, ULEB128_7 (62), /* $f30 */
++ DW_CFA_same_value, ULEB128_7 (63), /* $f31 */
++
++ /* The CFA is the SP. */
++ DW_CFA_def_cfa, ULEB128_7 (29), ULEB128_7 (0),
++ };
++
++ abi_info->initial_instructions = abi_cfi;
++ abi_info->initial_instructions_end = &abi_cfi[sizeof abi_cfi];
++ abi_info->data_alignment_factor = 4;
++
++ abi_info->return_address_register = 31; /* $31 */
++
++ return 0;
++}
+diff --git a/backends/mips_init.c b/backends/mips_init.c
+index 8482e7f..bce5abe 100644
+--- a/backends/mips_init.c
++++ b/backends/mips_init.c
+@@ -50,6 +50,7 @@ mips_init (Elf *elf __attribute__ ((unused)),
+ HOOK (eh, reloc_simple_type);
+ HOOK (eh, return_value_location);
+ HOOK (eh, register_info);
++ HOOK (eh, abi_cfi);
+
+ return MODVERSION;
+ }
diff --git a/external/poky/meta/recipes-devtools/elfutils/files/debian/mips_readelf_w.patch b/external/poky/meta/recipes-devtools/elfutils/files/debian/mips_readelf_w.patch
index d26e72e2..c6d42e16 100644
--- a/external/poky/meta/recipes-devtools/elfutils/files/debian/mips_readelf_w.patch
+++ b/external/poky/meta/recipes-devtools/elfutils/files/debian/mips_readelf_w.patch
@@ -1,19 +1,22 @@
-From: Kurt Roeckx <kurt@roeckx.be>
-Subject: Make readelf -w output debug information on mips
-Bug-Debian: http://bugs.debian.org/662041
-Forwarded: not-needed
-
-Upstreams wants a change where this is handled by a hook that needs
-to be filled in by the backend for the arch.
+From 7bdc83296865cf2b2a5615dbdb7ac0d441fb1849 Mon Sep 17 00:00:00 2001
+From: Hongxu Jia <hongxu.jia@windriver.com>
+Date: Wed, 21 Aug 2019 16:55:01 +0800
+Subject: [PATCH] mips_readelf_w
Upstream-Status: Pending [from debian]
+
+Rebase to 0.177
+
Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
+---
+ src/readelf.c | 3 ++-
+ 1 file changed, 2 insertions(+), 1 deletion(-)
-Index: elfutils-0.175/src/readelf.c
-===================================================================
---- elfutils-0.175.orig/src/readelf.c
-+++ elfutils-0.175/src/readelf.c
-@@ -11133,7 +11133,8 @@ print_debug (Dwfl_Module *dwflmod, Ebl *
+diff --git a/src/readelf.c b/src/readelf.c
+index 2084fb1..5c02a9b 100644
+--- a/src/readelf.c
++++ b/src/readelf.c
+@@ -11256,7 +11256,8 @@ print_debug (Dwfl_Module *dwflmod, Ebl *ebl, GElf_Ehdr *ehdr)
GElf_Shdr shdr_mem;
GElf_Shdr *shdr = gelf_getshdr (scn, &shdr_mem);
@@ -23,3 +26,6 @@ Index: elfutils-0.175/src/readelf.c
{
static const struct
{
+--
+2.7.4
+
diff --git a/external/poky/meta/recipes-devtools/elfutils/files/debian/testsuite-ignore-elflint.diff b/external/poky/meta/recipes-devtools/elfutils/files/debian/testsuite-ignore-elflint.diff
new file mode 100644
index 00000000..e6d7948c
--- /dev/null
+++ b/external/poky/meta/recipes-devtools/elfutils/files/debian/testsuite-ignore-elflint.diff
@@ -0,0 +1,52 @@
+From 6393b0e57872b3ffedf0dbd6784cd29694010878 Mon Sep 17 00:00:00 2001
+From: Hongxu Jia <hongxu.jia@windriver.com>
+Date: Wed, 21 Aug 2019 16:59:01 +0800
+Subject: [PATCH 1/2] testsuite-ignore-elflint
+
+Upstream-Status: Pending [from debian]
+
+Rebase to 0.177
+
+Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
+---
+ tests/run-elflint-self.sh | 2 +-
+ tests/test-subr.sh | 15 +++++++++++++++
+ 2 files changed, 16 insertions(+), 1 deletion(-)
+
+diff --git a/tests/run-elflint-self.sh b/tests/run-elflint-self.sh
+index 58fa7d0..85d21a5 100755
+--- a/tests/run-elflint-self.sh
++++ b/tests/run-elflint-self.sh
+@@ -18,5 +18,5 @@
+
+ . $srcdir/test-subr.sh
+
+-testrun_on_self ${abs_top_builddir}/src/elflint --quiet --gnu-ld
++testrun_on_self_skip ${abs_top_builddir}/src/elflint --quiet --gnu-ld
+ testrun_on_self_compressed ${abs_top_builddir}/src/elflint --quiet --gnu-ld
+diff --git a/tests/test-subr.sh b/tests/test-subr.sh
+index 09f428d..26f61f1 100644
+--- a/tests/test-subr.sh
++++ b/tests/test-subr.sh
+@@ -201,3 +201,18 @@ testrun_on_self_quiet()
+ # Only exit if something failed
+ if test $exit_status != 0; then exit $exit_status; fi
+ }
++
++# Same as testrun_on_self(), but skip on failure.
++testrun_on_self_skip()
++{
++ exit_status=0
++
++ for file in $self_test_files; do
++ testrun $* $file \
++ || { echo "*** failure in $* $file"; exit_status=77; }
++ done
++
++ # Only exit if something failed
++ if test $exit_status != 0; then exit $exit_status; fi
++}
++
+--
+2.7.4
+
diff --git a/external/poky/meta/recipes-devtools/elfutils/files/ptest.patch b/external/poky/meta/recipes-devtools/elfutils/files/ptest.patch
new file mode 100644
index 00000000..35b23f43
--- /dev/null
+++ b/external/poky/meta/recipes-devtools/elfutils/files/ptest.patch
@@ -0,0 +1,76 @@
+Changes to allow ptest to run standalone on target:
+
+a) Run the tests serially
+b) Use the standalone test mode which allows the tests to be run in their
+ 'installled' locations on target (but not any of the standalone build pieces)
+c) We want to use the binaries from their installed locations so the run-subr
+ script needs tweaking to run them like that. The rpath conditional isn't
+ enough since we want the second entry in the case statement.
+d) Add an oecheck make target which we can use to build the test binaries we need
+
+Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
+
+Upstream-Status: Inappropriate [oe specific]
+
+Index: elfutils-0.176/configure.ac
+===================================================================
+--- elfutils-0.176.orig/configure.ac
++++ elfutils-0.176/configure.ac
+@@ -45,7 +45,7 @@ AC_COPYRIGHT([Copyright (C) 1996-2018 Th
+ AC_PREREQ(2.63) dnl Minimum Autoconf version required.
+
+ dnl We use GNU make extensions; automake 1.10 defaults to -Wportability.
+-AM_INIT_AUTOMAKE([gnits 1.11 -Wno-portability dist-bzip2 no-dist-gzip parallel-tests])
++AM_INIT_AUTOMAKE([gnits 1.11 -Wno-portability dist-bzip2 no-dist-gzip serial-tests])
+ AM_MAINTAINER_MODE
+
+ AM_SILENT_RULES([yes])
+Index: elfutils-0.176/tests/Makefile.am
+===================================================================
+--- elfutils-0.176.orig/tests/Makefile.am
++++ elfutils-0.176/tests/Makefile.am
+@@ -445,10 +445,10 @@ installed_TESTS_ENVIRONMENT = libdir=$(D
+ installed_LOG_COMPILER = $(abs_srcdir)/test-wrapper.sh \
+ installed $(tests_rpath) \
+ '$(program_transform_name)'
+-if STANDALONE
++if !STANDALONE
+ TESTS_ENVIRONMENT = $(installed_TESTS_ENVIRONMENT)
+ LOG_COMPILER = $(installed_LOG_COMPILER)
+-else !STANDALONE
++else STANDALONE
+ TESTS_ENVIRONMENT = LC_ALL=C; LANG=C; VALGRIND_CMD=$(valgrind_cmd); \
+ abs_srcdir=$(abs_srcdir); abs_builddir=$(abs_builddir); \
+ abs_top_builddir=$(abs_top_builddir); \
+@@ -463,7 +463,7 @@ installcheck-local:
+ $(MAKE) $(AM_MAKEFLAGS) \
+ TESTS_ENVIRONMENT="$(installed_TESTS_ENVIRONMENT)" \
+ LOG_COMPILER="$(installed_LOG_COMPILER)" check-TESTS
+-endif !STANDALONE
++endif STANDALONE
+
+ if STANDALONE
+ libdw = -ldw
+@@ -612,3 +612,5 @@ check: check-am coverage
+ coverage:
+ -$(srcdir)/coverage.sh
+ endif
++oecheck:
++ $(MAKE) $(AM_MAKEFLAGS) $(check_PROGRAMS)
+Index: elfutils-0.176/tests/test-subr.sh
+===================================================================
+--- elfutils-0.176.orig/tests/test-subr.sh
++++ elfutils-0.176/tests/test-subr.sh
+@@ -91,12 +91,6 @@ installed_testrun()
+ program="$1"
+ shift
+ case "$program" in
+- ${abs_builddir}/*)
+- if [ "x$elfutils_tests_rpath" != xno ]; then
+- echo >&2 installcheck not possible with --enable-tests-rpath
+- exit 77
+- fi
+- ;;
+ ${abs_top_builddir}/src/*)
+ program=${bindir}/`program_transform ${program##*/}`
+ ;;
diff --git a/external/poky/meta/recipes-devtools/elfutils/files/run-ptest b/external/poky/meta/recipes-devtools/elfutils/files/run-ptest
new file mode 100644
index 00000000..81b81f2f
--- /dev/null
+++ b/external/poky/meta/recipes-devtools/elfutils/files/run-ptest
@@ -0,0 +1,6 @@
+#!/bin/sh
+#
+#This script is used to run elfutils test suites
+cd tests
+
+make -k runtest-TESTS abs_srcdir=$PWD abs_builddir=$PWD srcdir=$PWD top_srcdir=$PWD/../ abs_top_builddir=$PWD/../ elfutils_testrun=installed elfutils_tests_rpath=no program_transform_name=s,^,eu-,