From 60857bd2d4c4f78e452f131fa763a86ed56fc22e Mon Sep 17 00:00:00 2001 From: Hongxu Jia Date: Mon, 2 Jul 2018 13:57:09 +0800 Subject: elfutils: 0.170 -> 0.172 - Update debian 0.170 patches and rebase them for 0.172; - Drop 0001-Use-fallthrough-attribute.patch which was accepted by upstream; - Drop 0001-Ensure-that-packed-structs-follow-the-gcc-memory-lay.patch which was backported from upstream; (From OE-Core rev: dbbe9c1d1f822cf13a4c16b79bccf6bf5c4b91e4) Signed-off-by: Hongxu Jia Signed-off-by: Ross Burton Signed-off-by: Richard Purdie --- meta/recipes-devtools/elfutils/elfutils_0.170.bb | 70 -- meta/recipes-devtools/elfutils/elfutils_0.172.bb | 74 ++ .../elfutils/files/0001-dso-link-change.patch | 8 +- ...0001-libasm-may-link-with-libbz2-if-found.patch | 12 +- ...-elf_cvt_gunhash-if-dest-and-src-are-same.patch | 4 +- .../elfutils/files/0003-fixheadercheck.patch | 6 +- .../0004-Disable-the-test-to-convert-euc-jp.patch | 4 +- .../files/0005-fix-a-stack-usage-warning.patch | 8 +- .../files/0006-Fix-build-on-aarch64-musl.patch | 4 +- ...-path-where-we-have-str-as-uninitialized-.patch | 12 +- ...de-alternatives-for-glibc-assumptions-hel.patch | 201 ++--- ...ferences-between-mips-machine-identifiers.patch | 4 - .../elfutils/files/debian/0001-arm_backend.patch | 627 +++++++++++++++ .../files/debian/0001-disable_werror.patch | 35 + .../files/debian/0001-fix-gcc7-ftbfs.patch | 57 ++ .../elfutils/files/debian/0001-hppa_backend.patch | 840 +++++++++++++++++++++ .../elfutils/files/debian/0001-mips_backend.patch | 718 ++++++++++++++++++ .../files/debian/0001-mips_readelf_w.patch | 39 + .../debian/0001-testsuite-ignore-elflint.patch | 57 ++ ...-support-for-mips64-abis-in-mips_retval.c.patch | 3 - .../0003-Add-mips-n64-relocation-format-hack.patch | 5 +- .../elfutils/files/debian/arm_backend.diff | 603 --------------- .../elfutils/files/debian/hppa_backend.diff | 802 -------------------- .../elfutils/files/debian/hurd_path.patch | 14 + .../elfutils/files/debian/ignore_strmerge.diff | 11 + .../elfutils/files/debian/kfreebsd_path.patch | 17 + .../elfutils/files/debian/mips_backend.patch | 715 ------------------ .../elfutils/files/debian/mips_readelf_w.patch | 25 - 28 files changed, 2601 insertions(+), 2374 deletions(-) delete mode 100644 meta/recipes-devtools/elfutils/elfutils_0.170.bb create mode 100644 meta/recipes-devtools/elfutils/elfutils_0.172.bb create mode 100644 meta/recipes-devtools/elfutils/files/debian/0001-arm_backend.patch create mode 100644 meta/recipes-devtools/elfutils/files/debian/0001-disable_werror.patch create mode 100644 meta/recipes-devtools/elfutils/files/debian/0001-fix-gcc7-ftbfs.patch create mode 100644 meta/recipes-devtools/elfutils/files/debian/0001-hppa_backend.patch create mode 100644 meta/recipes-devtools/elfutils/files/debian/0001-mips_backend.patch create mode 100644 meta/recipes-devtools/elfutils/files/debian/0001-mips_readelf_w.patch create mode 100644 meta/recipes-devtools/elfutils/files/debian/0001-testsuite-ignore-elflint.patch delete mode 100644 meta/recipes-devtools/elfutils/files/debian/arm_backend.diff delete mode 100644 meta/recipes-devtools/elfutils/files/debian/hppa_backend.diff create mode 100644 meta/recipes-devtools/elfutils/files/debian/hurd_path.patch create mode 100644 meta/recipes-devtools/elfutils/files/debian/ignore_strmerge.diff create mode 100644 meta/recipes-devtools/elfutils/files/debian/kfreebsd_path.patch delete mode 100644 meta/recipes-devtools/elfutils/files/debian/mips_backend.patch delete mode 100644 meta/recipes-devtools/elfutils/files/debian/mips_readelf_w.patch diff --git a/meta/recipes-devtools/elfutils/elfutils_0.170.bb b/meta/recipes-devtools/elfutils/elfutils_0.170.bb deleted file mode 100644 index 14ac22ee64..0000000000 --- a/meta/recipes-devtools/elfutils/elfutils_0.170.bb +++ /dev/null @@ -1,70 +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.168-0.2.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://0005-fix-a-stack-usage-warning.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://debian/hppa_backend.diff \ - file://debian/arm_backend.diff \ - file://debian/mips_backend.patch \ - file://debian/mips_readelf_w.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://0001-Use-fallthrough-attribute.patch \ - file://0001-Ensure-that-packed-structs-follow-the-gcc-memory-lay.patch \ - " -SRC_URI_append_libc-musl = " file://0008-build-Provide-alternatives-for-glibc-assumptions-hel.patch" -SRC_URI[md5sum] = "03599aee98c9b726c7a732a2dd0245d5" -SRC_URI[sha256sum] = "1f844775576b79bdc9f9c717a50058d08620323c1e935458223a12f249c9e066" - -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., 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/meta/recipes-devtools/elfutils/elfutils_0.172.bb b/meta/recipes-devtools/elfutils/elfutils_0.172.bb new file mode 100644 index 0000000000..04f6709d5a --- /dev/null +++ b/meta/recipes-devtools/elfutils/elfutils_0.172.bb @@ -0,0 +1,74 @@ +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.170-0.5.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://0005-fix-a-stack-usage-warning.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://debian/0001-hppa_backend.patch \ + file://debian/0001-arm_backend.patch \ + file://debian/0001-mips_backend.patch \ + file://debian/0001-testsuite-ignore-elflint.patch \ + file://debian/0001-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/0001-fix-gcc7-ftbfs.patch \ + file://debian/0001-disable_werror.patch \ + " +SRC_URI_append_libc-musl = " file://0008-build-Provide-alternatives-for-glibc-assumptions-hel.patch" +SRC_URI[md5sum] = "01e87ab4c5a6a249c04e22a97a4221d3" +SRC_URI[sha256sum] = "779c99e6344c4982bbab60b8d276cec3d468151c758905f9a44ba6b6edaa0e24" + +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., 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/meta/recipes-devtools/elfutils/files/0001-dso-link-change.patch b/meta/recipes-devtools/elfutils/files/0001-dso-link-change.patch index 28c57f236c..4c62dc511c 100644 --- a/meta/recipes-devtools/elfutils/files/0001-dso-link-change.patch +++ b/meta/recipes-devtools/elfutils/files/0001-dso-link-change.patch @@ -1,4 +1,4 @@ -From 0a69a26c9f7487daca900db87cd1195857a4603f Mon Sep 17 00:00:00 2001 +From c9c6d2414651dbf163dc4963c3c3d6f5cacef898 Mon Sep 17 00:00:00 2001 From: Hongxu Jia Date: Tue, 15 Aug 2017 17:10:57 +0800 Subject: [PATCH 1/7] dso link change @@ -35,10 +35,10 @@ index 2b1c0dc..9305b84 100644 endif libebl = ../libebl/libebl.a diff --git a/tests/Makefile.am b/tests/Makefile.am -index 3735084..528615d 100644 +index b45ecdc..dd256fb 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am -@@ -400,7 +400,7 @@ libdw = ../libdw/libdw.a -lz $(zip_LIBS) $(libelf) $(libebl) -ldl +@@ -436,7 +436,7 @@ libdw = ../libdw/libdw.a -lz $(zip_LIBS) $(libelf) $(libebl) -ldl libelf = ../libelf/libelf.a -lz libasm = ../libasm/libasm.a else @@ -48,5 +48,5 @@ index 3735084..528615d 100644 libasm = ../libasm/libasm.so endif -- -1.8.3.1 +2.7.4 diff --git a/meta/recipes-devtools/elfutils/files/0001-libasm-may-link-with-libbz2-if-found.patch b/meta/recipes-devtools/elfutils/files/0001-libasm-may-link-with-libbz2-if-found.patch index fb0b060b4b..a8e9e50d15 100644 --- a/meta/recipes-devtools/elfutils/files/0001-libasm-may-link-with-libbz2-if-found.patch +++ b/meta/recipes-devtools/elfutils/files/0001-libasm-may-link-with-libbz2-if-found.patch @@ -1,4 +1,4 @@ -From 7672e363468271b4c63ff58770c5aac15ab8f722 Mon Sep 17 00:00:00 2001 +From 74629016e76343a4bf39915c9192b6bf26a57c2d Mon Sep 17 00:00:00 2001 From: Khem Raj Date: Wed, 4 Oct 2017 22:30:46 -0700 Subject: [PATCH] libasm may link with libbz2 if found @@ -11,13 +11,11 @@ where indirect libraries may be not found by linker Signed-off-by: Khem Raj --- -Upstream-Status: Pending - - src/Makefile.am | 6 +++--- - 1 file changed, 3 insertions(+), 3 deletions(-) + src/Makefile.am | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Makefile.am b/src/Makefile.am -index e03bc32..9b7e853 100644 +index 9305b84..9b7e853 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -39,11 +39,11 @@ EXTRA_DIST += make-debug-archive.in @@ -35,5 +33,5 @@ index e03bc32..9b7e853 100644 libelf = ../libelf/libelf.so endif -- -2.14.2 +2.7.4 diff --git a/meta/recipes-devtools/elfutils/files/0002-Fix-elf_cvt_gunhash-if-dest-and-src-are-same.patch b/meta/recipes-devtools/elfutils/files/0002-Fix-elf_cvt_gunhash-if-dest-and-src-are-same.patch index 2f718eb827..86d26bdf35 100644 --- a/meta/recipes-devtools/elfutils/files/0002-Fix-elf_cvt_gunhash-if-dest-and-src-are-same.patch +++ b/meta/recipes-devtools/elfutils/files/0002-Fix-elf_cvt_gunhash-if-dest-and-src-are-same.patch @@ -1,4 +1,4 @@ -From e98670f7c7b4c73fb65534949716fd8d043960d5 Mon Sep 17 00:00:00 2001 +From 9fd4bb05d3f2b7eaf9fe441bee26d3b1878d7cc7 Mon Sep 17 00:00:00 2001 From: Hongxu Jia Date: Tue, 15 Aug 2017 17:13:59 +0800 Subject: [PATCH 2/7] Fix elf_cvt_gunhash if dest and src are same. @@ -38,5 +38,5 @@ index 6faf113..04d9ca1 100644 /* Now the 64 bit words. */ Elf64_Xword *dest64 = (Elf64_Xword *) &dest32[4]; -- -1.8.3.1 +2.7.4 diff --git a/meta/recipes-devtools/elfutils/files/0003-fixheadercheck.patch b/meta/recipes-devtools/elfutils/files/0003-fixheadercheck.patch index 7c49fced10..d1c8e4143e 100644 --- a/meta/recipes-devtools/elfutils/files/0003-fixheadercheck.patch +++ b/meta/recipes-devtools/elfutils/files/0003-fixheadercheck.patch @@ -1,4 +1,4 @@ -From 565d5935abf5b58773f9c8385c00189221980d98 Mon Sep 17 00:00:00 2001 +From 04fb3f65ec186df5231dd0c21780a55dcc03c868 Mon Sep 17 00:00:00 2001 From: Hongxu Jia Date: Tue, 15 Aug 2017 17:17:20 +0800 Subject: [PATCH 3/7] fixheadercheck @@ -21,7 +21,7 @@ Signed-off-by: Hongxu Jia 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libelf/elf32_updatenull.c b/libelf/elf32_updatenull.c -index d83c0b3..a51bf70 100644 +index 3e9ef61..5351518 100644 --- a/libelf/elf32_updatenull.c +++ b/libelf/elf32_updatenull.c @@ -339,8 +339,8 @@ __elfw2(LIBELFBITS,updatenull_wrlock) (Elf *elf, int *change_bop, size_t shnum) @@ -36,5 +36,5 @@ index d83c0b3..a51bf70 100644 __libelf_seterrno (ELF_E_INVALID_ALIGN); return -1; -- -1.8.3.1 +2.7.4 diff --git a/meta/recipes-devtools/elfutils/files/0004-Disable-the-test-to-convert-euc-jp.patch b/meta/recipes-devtools/elfutils/files/0004-Disable-the-test-to-convert-euc-jp.patch index d893ad68f6..bf3a645bc6 100644 --- a/meta/recipes-devtools/elfutils/files/0004-Disable-the-test-to-convert-euc-jp.patch +++ b/meta/recipes-devtools/elfutils/files/0004-Disable-the-test-to-convert-euc-jp.patch @@ -1,4 +1,4 @@ -From bb7ed11950101798aae82f7fda8b3dcb05f755c5 Mon Sep 17 00:00:00 2001 +From dbc88349b9eed4268db951df2c3a8387f75a32e7 Mon Sep 17 00:00:00 2001 From: Hongxu Jia Date: Tue, 15 Aug 2017 17:24:06 +0800 Subject: [PATCH 4/7] Disable the test to convert euc-jp @@ -40,5 +40,5 @@ index a503646..299f1eb 100644 }]])], [am_cv_func_iconv_works=yes], -- -1.8.3.1 +2.7.4 diff --git a/meta/recipes-devtools/elfutils/files/0005-fix-a-stack-usage-warning.patch b/meta/recipes-devtools/elfutils/files/0005-fix-a-stack-usage-warning.patch index 22a01cfa71..e2966cbea4 100644 --- a/meta/recipes-devtools/elfutils/files/0005-fix-a-stack-usage-warning.patch +++ b/meta/recipes-devtools/elfutils/files/0005-fix-a-stack-usage-warning.patch @@ -1,4 +1,4 @@ -From dd6dbf6af396519380f48c0ef1ce6cf4dd77f6d7 Mon Sep 17 00:00:00 2001 +From 4d7ea681932556ad881f6841de90d0bfff56f8d7 Mon Sep 17 00:00:00 2001 From: Hongxu Jia Date: Tue, 15 Aug 2017 17:25:16 +0800 Subject: [PATCH 5/7] fix a stack-usage warning @@ -18,10 +18,10 @@ Signed-off-by: Hongxu Jia 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/backends/ppc_initreg.c b/backends/ppc_initreg.c -index 69d623b..de41dec 100644 +index 3e4432f..59c2d97 100644 --- a/backends/ppc_initreg.c +++ b/backends/ppc_initreg.c -@@ -93,7 +93,7 @@ ppc_set_initial_registers_tid (pid_t tid __attribute__ ((unused)), +@@ -94,7 +94,7 @@ ppc_set_initial_registers_tid (pid_t tid __attribute__ ((unused)), return false; } const size_t gprs = sizeof (user_regs.r.gpr) / sizeof (*user_regs.r.gpr); @@ -31,5 +31,5 @@ index 69d623b..de41dec 100644 dwarf_regs[gpr] = user_regs.r.gpr[gpr]; if (! setfunc (0, gprs, dwarf_regs, arg)) -- -1.8.3.1 +2.7.4 diff --git a/meta/recipes-devtools/elfutils/files/0006-Fix-build-on-aarch64-musl.patch b/meta/recipes-devtools/elfutils/files/0006-Fix-build-on-aarch64-musl.patch index 5f29a03759..40b8544fa5 100644 --- a/meta/recipes-devtools/elfutils/files/0006-Fix-build-on-aarch64-musl.patch +++ b/meta/recipes-devtools/elfutils/files/0006-Fix-build-on-aarch64-musl.patch @@ -1,4 +1,4 @@ -From e57ad47fc8549353ca80c23b9b4f38f31fde13e5 Mon Sep 17 00:00:00 2001 +From b4ec05953f78af26bcd7de45a5bbc5f138d023da Mon Sep 17 00:00:00 2001 From: Hongxu Jia Date: Tue, 15 Aug 2017 17:27:30 +0800 Subject: [PATCH 6/7] Fix build on aarch64/musl @@ -57,5 +57,5 @@ index efcabaf..062bb9e 100644 # include /* Deal with old glibc defining user_pt_regs instead of user_regs_struct. */ -- -1.8.3.1 +2.7.4 diff --git a/meta/recipes-devtools/elfutils/files/0007-Fix-control-path-where-we-have-str-as-uninitialized-.patch b/meta/recipes-devtools/elfutils/files/0007-Fix-control-path-where-we-have-str-as-uninitialized-.patch index 224770478d..bba420e349 100644 --- a/meta/recipes-devtools/elfutils/files/0007-Fix-control-path-where-we-have-str-as-uninitialized-.patch +++ b/meta/recipes-devtools/elfutils/files/0007-Fix-control-path-where-we-have-str-as-uninitialized-.patch @@ -1,6 +1,6 @@ -From 1e91c1d4e37c05cf95058b4b3c3f352d72886f58 Mon Sep 17 00:00:00 2001 +From 8eb100b2e51be5d473b0748a223e2e7f61ec606c Mon Sep 17 00:00:00 2001 From: Hongxu Jia -Date: Tue, 15 Aug 2017 17:31:38 +0800 +Date: Fri, 29 Jun 2018 15:14:28 +0800 Subject: [PATCH 7/7] Fix control path where we have str as uninitialized string @@ -21,7 +21,7 @@ note: 'str' was declared here Signed-off-by: Khem Raj Upstream-Status: Pending -Rebase to 0.170 +Rebase to 0.172 Signed-off-by: Hongxu Jia --- @@ -29,17 +29,17 @@ Signed-off-by: Hongxu Jia 1 file changed, 1 insertion(+) diff --git a/libcpu/i386_disasm.c b/libcpu/i386_disasm.c -index 831afbe..60fd6d4 100644 +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 */ + FALLTHROUGH; default: + str = ""; assert (! "INVALID not handled"); } } -- -1.8.3.1 +2.7.4 diff --git a/meta/recipes-devtools/elfutils/files/0008-build-Provide-alternatives-for-glibc-assumptions-hel.patch b/meta/recipes-devtools/elfutils/files/0008-build-Provide-alternatives-for-glibc-assumptions-hel.patch index a42ce7b358..e88f2c069c 100644 --- a/meta/recipes-devtools/elfutils/files/0008-build-Provide-alternatives-for-glibc-assumptions-hel.patch +++ b/meta/recipes-devtools/elfutils/files/0008-build-Provide-alternatives-for-glibc-assumptions-hel.patch @@ -1,16 +1,15 @@ -From ef0981744669149a00dd0439a54dac30de7b56a7 Mon Sep 17 00:00:00 2001 +From 207be05c44da5c4c31179a34660e176145ff8d4b Mon Sep 17 00:00:00 2001 From: Khem Raj -Date: Wed, 16 Aug 2017 10:06:26 +0800 +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 -Rebase to 0.170 +Rebase to 0.172 Signed-off-by: Hongxu Jia - --- Makefile.am | 2 +- lib/color.c | 3 ++- @@ -24,10 +23,9 @@ Signed-off-by: Hongxu Jia libcpu/i386_parse.c | 2 +- libdw/Makefile.am | 3 ++- libdw/libdw_alloc.c | 2 +- - libdwfl/dwfl_build_id_find_elf.c | 3 ++- + libdwfl/dwfl_build_id_find_elf.c | 1 + libdwfl/dwfl_error.c | 4 +++- libdwfl/dwfl_module_getdwarf.c | 1 + - libdwfl/find-debuginfo.c | 2 +- libdwfl/libdwfl_crc32_file.c | 9 +++++++++ libdwfl/linux-kernel-modules.c | 1 + libebl/eblopenbackend.c | 2 +- @@ -75,16 +73,15 @@ Signed-off-by: Hongxu Jia tests/getsrc_die.c | 2 +- tests/line2addr.c | 2 +- tests/low_high_pc.c | 2 +- - tests/md5-sha1-test.c | 2 +- tests/rdwrmmap.c | 2 +- tests/saridx.c | 2 +- tests/sectiondump.c | 2 +- tests/varlocs.c | 2 +- tests/vdsosyms.c | 2 +- - 69 files changed, 95 insertions(+), 64 deletions(-) + 67 files changed, 92 insertions(+), 61 deletions(-) diff --git a/Makefile.am b/Makefile.am -index 2ff444e7..41f77df8 100644 +index 2ff444e..41f77df 100644 --- a/Makefile.am +++ b/Makefile.am @@ -28,7 +28,7 @@ pkginclude_HEADERS = version.h @@ -97,7 +94,7 @@ index 2ff444e7..41f77df8 100644 EXTRA_DIST = elfutils.spec GPG-KEY NOTES CONTRIBUTING \ COPYING COPYING-GPLV2 COPYING-LGPLV3 diff --git a/lib/color.c b/lib/color.c -index f62389d5..a2a84b46 100644 +index f62389d..a2a84b4 100644 --- a/lib/color.c +++ b/lib/color.c @@ -32,13 +32,14 @@ @@ -117,7 +114,7 @@ index f62389d5..a2a84b46 100644 /* Prototype for option handler. */ static error_t parse_opt (int key, char *arg, struct argp_state *state); diff --git a/lib/fixedsizehash.h b/lib/fixedsizehash.h -index dac2a5f5..43016fc3 100644 +index dac2a5f..43016fc 100644 --- a/lib/fixedsizehash.h +++ b/lib/fixedsizehash.h @@ -30,7 +30,6 @@ @@ -129,7 +126,7 @@ index dac2a5f5..43016fc3 100644 #include diff --git a/lib/system.h b/lib/system.h -index 92033355..1a601319 100644 +index 9203335..1a60131 100644 --- a/lib/system.h +++ b/lib/system.h @@ -50,6 +50,16 @@ @@ -150,7 +147,7 @@ index 92033355..1a601319 100644 #ifndef MAX #define MAX(m, n) ((m) < (n) ? (n) : (m)) diff --git a/lib/xmalloc.c b/lib/xmalloc.c -index 0cde384f..217b0541 100644 +index 0cde384..217b054 100644 --- a/lib/xmalloc.c +++ b/lib/xmalloc.c @@ -30,7 +30,7 @@ @@ -163,7 +160,7 @@ index 0cde384f..217b0541 100644 #include #include diff --git a/libasm/asm_end.c b/libasm/asm_end.c -index ced24f50..4ad918c4 100644 +index ced24f5..4ad918c 100644 --- a/libasm/asm_end.c +++ b/libasm/asm_end.c @@ -32,7 +32,7 @@ @@ -176,7 +173,7 @@ index ced24f50..4ad918c4 100644 #include #include diff --git a/libasm/asm_newscn.c b/libasm/asm_newscn.c -index ddbb25df..74a598d9 100644 +index ddbb25d..74a598d 100644 --- a/libasm/asm_newscn.c +++ b/libasm/asm_newscn.c @@ -32,7 +32,7 @@ @@ -189,7 +186,7 @@ index ddbb25df..74a598d9 100644 #include #include diff --git a/libcpu/i386_gendis.c b/libcpu/i386_gendis.c -index aae5eae6..6d760165 100644 +index aae5eae..6d76016 100644 --- a/libcpu/i386_gendis.c +++ b/libcpu/i386_gendis.c @@ -31,7 +31,7 @@ @@ -202,10 +199,10 @@ index aae5eae6..6d760165 100644 #include #include diff --git a/libcpu/i386_lex.c b/libcpu/i386_lex.c -index ba5f4aa5..b1e41916 100644 +index facdf71..f13842f 100644 --- a/libcpu/i386_lex.c +++ b/libcpu/i386_lex.c -@@ -577,7 +577,7 @@ char *i386_text; +@@ -571,7 +571,7 @@ char *i386_text; #endif #include @@ -215,7 +212,7 @@ index ba5f4aa5..b1e41916 100644 #include diff --git a/libcpu/i386_parse.c b/libcpu/i386_parse.c -index 6fa7ce3d..bb270061 100644 +index 3c5058a..bf402d6 100644 --- a/libcpu/i386_parse.c +++ b/libcpu/i386_parse.c @@ -107,7 +107,7 @@ @@ -228,10 +225,10 @@ index 6fa7ce3d..bb270061 100644 #include #include diff --git a/libdw/Makefile.am b/libdw/Makefile.am -index ff8c291e..89e792aa 100644 +index 41df4f3..e6b275f 100644 --- a/libdw/Makefile.am +++ b/libdw/Makefile.am -@@ -105,7 +105,8 @@ am_libdw_pic_a_OBJECTS = $(libdw_a_SOURCES:.c=.os) +@@ -107,7 +107,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 @@ -242,7 +239,7 @@ index ff8c291e..89e792aa 100644 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/libdw/libdw_alloc.c b/libdw/libdw_alloc.c -index 28a8cf6e..29aeb3f7 100644 +index d6af23a..deb724c 100644 --- a/libdw/libdw_alloc.c +++ b/libdw/libdw_alloc.c @@ -31,7 +31,7 @@ @@ -255,7 +252,7 @@ index 28a8cf6e..29aeb3f7 100644 #include #include "libdwP.h" diff --git a/libdwfl/dwfl_build_id_find_elf.c b/libdwfl/dwfl_build_id_find_elf.c -index ee0c1646..b06ab596 100644 +index cc6c3f6..b06ab59 100644 --- a/libdwfl/dwfl_build_id_find_elf.c +++ b/libdwfl/dwfl_build_id_find_elf.c @@ -31,6 +31,7 @@ @@ -266,17 +263,8 @@ index ee0c1646..b06ab596 100644 #include #include #include -@@ -99,7 +100,7 @@ __libdwfl_open_by_build_id (Dwfl_Module *mod, bool debug, char **file_name, - { - if (*file_name != NULL) - free (*file_name); -- *file_name = canonicalize_file_name (name); -+ *file_name = realpath (name, NULL); - if (*file_name == NULL) - { - *file_name = name; diff --git a/libdwfl/dwfl_error.c b/libdwfl/dwfl_error.c -index 7bcf61cc..c345797a 100644 +index 7bcf61c..c345797 100644 --- a/libdwfl/dwfl_error.c +++ b/libdwfl/dwfl_error.c @@ -140,6 +140,7 @@ __libdwfl_seterrno (Dwfl_Error error) @@ -298,7 +286,7 @@ index 7bcf61cc..c345797a 100644 return elf_errmsg (error & 0xffff); case OTHER_ERROR (LIBDW): diff --git a/libdwfl/dwfl_module_getdwarf.c b/libdwfl/dwfl_module_getdwarf.c -index 9775aced..511c4a6a 100644 +index af6838a..c079d6a 100644 --- a/libdwfl/dwfl_module_getdwarf.c +++ b/libdwfl/dwfl_module_getdwarf.c @@ -35,6 +35,7 @@ @@ -309,21 +297,8 @@ index 9775aced..511c4a6a 100644 #include "../libdw/libdwP.h" /* DWARF_E_* values are here. */ #include "../libelf/libelfP.h" #include "system.h" -diff --git a/libdwfl/find-debuginfo.c b/libdwfl/find-debuginfo.c -index 6d5a42a6..9267788d 100644 ---- a/libdwfl/find-debuginfo.c -+++ b/libdwfl/find-debuginfo.c -@@ -389,7 +389,7 @@ dwfl_standard_find_debuginfo (Dwfl_Module *mod, - /* If FILE_NAME is a symlink, the debug file might be associated - with the symlink target name instead. */ - -- char *canon = canonicalize_file_name (file_name); -+ char *canon = realpath (file_name, NULL); - if (canon != NULL && strcmp (file_name, canon)) - fd = find_debuginfo_in_path (mod, canon, - debuglink_file, debuglink_crc, diff --git a/libdwfl/libdwfl_crc32_file.c b/libdwfl/libdwfl_crc32_file.c -index f849128d..6f0aca1b 100644 +index f849128..6f0aca1 100644 --- a/libdwfl/libdwfl_crc32_file.c +++ b/libdwfl/libdwfl_crc32_file.c @@ -29,6 +29,15 @@ @@ -343,7 +318,7 @@ index f849128d..6f0aca1b 100644 #define crc32 __libdwfl_crc32 #include diff --git a/libdwfl/linux-kernel-modules.c b/libdwfl/linux-kernel-modules.c -index 9d0fef2c..9fc09b88 100644 +index 9d0fef2..9fc09b8 100644 --- a/libdwfl/linux-kernel-modules.c +++ b/libdwfl/linux-kernel-modules.c @@ -40,6 +40,7 @@ @@ -355,7 +330,7 @@ index 9d0fef2c..9fc09b88 100644 #include #include diff --git a/libebl/eblopenbackend.c b/libebl/eblopenbackend.c -index 53713963..2e66dfdd 100644 +index 8b063f4..9bdeead 100644 --- a/libebl/eblopenbackend.c +++ b/libebl/eblopenbackend.c @@ -32,7 +32,7 @@ @@ -368,7 +343,7 @@ index 53713963..2e66dfdd 100644 #include #include diff --git a/libelf/elf.h b/libelf/elf.h -index 5cf2b934..990b3afb 100644 +index f774898..be277d0 100644 --- a/libelf/elf.h +++ b/libelf/elf.h @@ -21,7 +21,9 @@ @@ -382,9 +357,9 @@ index 5cf2b934..990b3afb 100644 /* Standard ELF types. */ -@@ -3705,6 +3707,8 @@ enum - #define R_BPF_NONE 0 /* No reloc */ - #define R_BPF_MAP_FD 1 /* Map fd to pointer */ +@@ -3912,6 +3914,8 @@ enum + #define R_METAG_TLS_LE_HI16 60 + #define R_METAG_TLS_LE_LO16 61 -__END_DECLS +#ifdef __cplusplus @@ -393,7 +368,7 @@ index 5cf2b934..990b3afb 100644 #endif /* elf.h */ diff --git a/libelf/libelf.h b/libelf/libelf.h -index 547c0f50..dd78799e 100644 +index 547c0f5..dd78799 100644 --- a/libelf/libelf.h +++ b/libelf/libelf.h @@ -29,6 +29,7 @@ @@ -405,7 +380,7 @@ index 547c0f50..dd78799e 100644 #include diff --git a/libelf/libelfP.h b/libelf/libelfP.h -index 7ee6625a..58408997 100644 +index ca805ac..47f25c2 100644 --- a/libelf/libelfP.h +++ b/libelf/libelfP.h @@ -32,6 +32,7 @@ @@ -417,7 +392,7 @@ index 7ee6625a..58408997 100644 #include #include diff --git a/src/addr2line.c b/src/addr2line.c -index 444ee52c..9596fa67 100644 +index 5acafa0..a4920b3 100644 --- a/src/addr2line.c +++ b/src/addr2line.c @@ -23,7 +23,7 @@ @@ -430,7 +405,7 @@ index 444ee52c..9596fa67 100644 #include #include diff --git a/src/ar.c b/src/ar.c -index ec32cee5..4efd729c 100644 +index 818115b..2166f1b 100644 --- a/src/ar.c +++ b/src/ar.c @@ -22,7 +22,7 @@ @@ -443,7 +418,7 @@ index ec32cee5..4efd729c 100644 #include #include diff --git a/src/arlib.c b/src/arlib.c -index e0839aab..1143658f 100644 +index e0839aa..1143658 100644 --- a/src/arlib.c +++ b/src/arlib.c @@ -21,7 +21,7 @@ @@ -456,7 +431,7 @@ index e0839aab..1143658f 100644 #include #include diff --git a/src/arlib2.c b/src/arlib2.c -index 553fc57b..46443d0e 100644 +index 553fc57..46443d0 100644 --- a/src/arlib2.c +++ b/src/arlib2.c @@ -20,7 +20,7 @@ @@ -469,7 +444,7 @@ index 553fc57b..46443d0e 100644 #include #include diff --git a/src/elfcmp.c b/src/elfcmp.c -index 50464207..cff183fa 100644 +index 5046420..cff183f 100644 --- a/src/elfcmp.c +++ b/src/elfcmp.c @@ -23,7 +23,7 @@ @@ -482,7 +457,7 @@ index 50464207..cff183fa 100644 #include #include diff --git a/src/elflint.c b/src/elflint.c -index df1b3a03..67d8d134 100644 +index 0a26d97..e45fb39 100644 --- a/src/elflint.c +++ b/src/elflint.c @@ -24,7 +24,7 @@ @@ -495,7 +470,7 @@ index df1b3a03..67d8d134 100644 #include #include diff --git a/src/findtextrel.c b/src/findtextrel.c -index 8f1e239a..71463af3 100644 +index 8f1e239..71463af 100644 --- a/src/findtextrel.c +++ b/src/findtextrel.c @@ -23,7 +23,7 @@ @@ -508,7 +483,7 @@ index 8f1e239a..71463af3 100644 #include #include diff --git a/src/nm.c b/src/nm.c -index 969c6d35..3113c04c 100644 +index 969c6d3..3113c04 100644 --- a/src/nm.c +++ b/src/nm.c @@ -26,7 +26,7 @@ @@ -521,7 +496,7 @@ index 969c6d35..3113c04c 100644 #include #include diff --git a/src/objdump.c b/src/objdump.c -index 0dd9a6aa..9c8bf149 100644 +index 0dd9a6a..9c8bf14 100644 --- a/src/objdump.c +++ b/src/objdump.c @@ -21,7 +21,7 @@ @@ -534,7 +509,7 @@ index 0dd9a6aa..9c8bf149 100644 #include #include diff --git a/src/ranlib.c b/src/ranlib.c -index cc0ee233..ae851e40 100644 +index cc0ee23..ae851e4 100644 --- a/src/ranlib.c +++ b/src/ranlib.c @@ -24,7 +24,7 @@ @@ -547,10 +522,10 @@ index cc0ee233..ae851e40 100644 #include #include diff --git a/src/readelf.c b/src/readelf.c -index 6a27e7e0..4759a965 100644 +index f185897..6623e93 100644 --- a/src/readelf.c +++ b/src/readelf.c -@@ -25,7 +25,7 @@ +@@ -24,7 +24,7 @@ #include #include #include @@ -560,7 +535,7 @@ index 6a27e7e0..4759a965 100644 #include #include diff --git a/src/size.c b/src/size.c -index ad8dbcbb..fd83be06 100644 +index ad8dbcb..fd83be0 100644 --- a/src/size.c +++ b/src/size.c @@ -21,7 +21,7 @@ @@ -573,7 +548,7 @@ index ad8dbcbb..fd83be06 100644 #include #include diff --git a/src/stack.c b/src/stack.c -index 6f2ff69f..6da0243d 100644 +index 52ae3a8..0fda285 100644 --- a/src/stack.c +++ b/src/stack.c @@ -18,7 +18,7 @@ @@ -586,7 +561,7 @@ index 6f2ff69f..6da0243d 100644 #include #include diff --git a/src/strings.c b/src/strings.c -index 03d0f133..5c311cbd 100644 +index 03d0f13..5c311cb 100644 --- a/src/strings.c +++ b/src/strings.c @@ -25,7 +25,7 @@ @@ -599,7 +574,7 @@ index 03d0f133..5c311cbd 100644 #include #include diff --git a/src/strip.c b/src/strip.c -index c7830ec6..0d7f148d 100644 +index 773ed54..ff05f46 100644 --- a/src/strip.c +++ b/src/strip.c @@ -24,7 +24,7 @@ @@ -612,7 +587,7 @@ index c7830ec6..0d7f148d 100644 #include #include diff --git a/src/unstrip.c b/src/unstrip.c -index 50749093..3d4f9525 100644 +index f368e69..5ca83d0 100644 --- a/src/unstrip.c +++ b/src/unstrip.c @@ -31,7 +31,7 @@ @@ -625,7 +600,7 @@ index 50749093..3d4f9525 100644 #include #include diff --git a/tests/addrscopes.c b/tests/addrscopes.c -index 791569f5..54f4311b 100644 +index 791569f..54f4311 100644 --- a/tests/addrscopes.c +++ b/tests/addrscopes.c @@ -25,7 +25,7 @@ @@ -638,7 +613,7 @@ index 791569f5..54f4311b 100644 diff --git a/tests/allregs.c b/tests/allregs.c -index 286f7e3c..c9de0897 100644 +index 286f7e3..c9de089 100644 --- a/tests/allregs.c +++ b/tests/allregs.c @@ -21,7 +21,7 @@ @@ -651,7 +626,7 @@ index 286f7e3c..c9de0897 100644 #include #include diff --git a/tests/backtrace-data.c b/tests/backtrace-data.c -index a387d8ff..955c27d1 100644 +index a387d8f..955c27d 100644 --- a/tests/backtrace-data.c +++ b/tests/backtrace-data.c @@ -27,7 +27,7 @@ @@ -664,10 +639,10 @@ index a387d8ff..955c27d1 100644 #include #if defined(__x86_64__) && defined(__linux__) diff --git a/tests/backtrace-dwarf.c b/tests/backtrace-dwarf.c -index 2dc8a9a2..24ca7fb0 100644 +index 7ff826c..246650b 100644 --- a/tests/backtrace-dwarf.c +++ b/tests/backtrace-dwarf.c -@@ -22,7 +22,7 @@ +@@ -21,7 +21,7 @@ #include #include #include @@ -675,9 +650,9 @@ index 2dc8a9a2..24ca7fb0 100644 +#include #include #include - #include + #include ELFUTILS_HEADER(dwfl) diff --git a/tests/backtrace.c b/tests/backtrace.c -index f5dd761f..a93a8f03 100644 +index f5dd761..a93a8f0 100644 --- a/tests/backtrace.c +++ b/tests/backtrace.c @@ -24,7 +24,7 @@ @@ -690,7 +665,7 @@ index f5dd761f..a93a8f03 100644 #include #ifdef __linux__ diff --git a/tests/buildid.c b/tests/buildid.c -index 87c18773..2953e6bb 100644 +index 87c1877..2953e6b 100644 --- a/tests/buildid.c +++ b/tests/buildid.c @@ -23,7 +23,7 @@ @@ -703,7 +678,7 @@ index 87c18773..2953e6bb 100644 #include #include diff --git a/tests/debugaltlink.c b/tests/debugaltlink.c -index 6d97d500..ee7e559e 100644 +index 6d97d50..ee7e559 100644 --- a/tests/debugaltlink.c +++ b/tests/debugaltlink.c @@ -23,7 +23,7 @@ @@ -716,7 +691,7 @@ index 6d97d500..ee7e559e 100644 #include #include diff --git a/tests/debuglink.c b/tests/debuglink.c -index 935d1029..741cb814 100644 +index 935d102..741cb81 100644 --- a/tests/debuglink.c +++ b/tests/debuglink.c @@ -21,7 +21,7 @@ @@ -729,7 +704,7 @@ index 935d1029..741cb814 100644 #include #include diff --git a/tests/deleted.c b/tests/deleted.c -index 6be35bc2..01907113 100644 +index 6be35bc..0190711 100644 --- a/tests/deleted.c +++ b/tests/deleted.c @@ -21,7 +21,7 @@ @@ -742,7 +717,7 @@ index 6be35bc2..01907113 100644 #ifdef __linux__ #include diff --git a/tests/dwfl-addr-sect.c b/tests/dwfl-addr-sect.c -index 21e470a3..1ea1e3b2 100644 +index 21e470a..1ea1e3b 100644 --- a/tests/dwfl-addr-sect.c +++ b/tests/dwfl-addr-sect.c @@ -23,7 +23,7 @@ @@ -755,7 +730,7 @@ index 21e470a3..1ea1e3b2 100644 #include #include ELFUTILS_HEADER(dwfl) diff --git a/tests/dwfl-bug-addr-overflow.c b/tests/dwfl-bug-addr-overflow.c -index aa8030e1..02c8bef9 100644 +index aa8030e..02c8bef 100644 --- a/tests/dwfl-bug-addr-overflow.c +++ b/tests/dwfl-bug-addr-overflow.c @@ -20,7 +20,7 @@ @@ -768,7 +743,7 @@ index aa8030e1..02c8bef9 100644 #include ELFUTILS_HEADER(dwfl) diff --git a/tests/dwfl-bug-fd-leak.c b/tests/dwfl-bug-fd-leak.c -index 689cdd79..5973da39 100644 +index 689cdd7..5973da3 100644 --- a/tests/dwfl-bug-fd-leak.c +++ b/tests/dwfl-bug-fd-leak.c @@ -24,7 +24,7 @@ @@ -781,7 +756,7 @@ index 689cdd79..5973da39 100644 #include diff --git a/tests/dwfl-bug-getmodules.c b/tests/dwfl-bug-getmodules.c -index 1ee989f8..fd62e653 100644 +index 1ee989f..fd62e65 100644 --- a/tests/dwfl-bug-getmodules.c +++ b/tests/dwfl-bug-getmodules.c @@ -18,7 +18,7 @@ @@ -794,7 +769,7 @@ index 1ee989f8..fd62e653 100644 static const Dwfl_Callbacks callbacks = { diff --git a/tests/dwfl-report-elf-align.c b/tests/dwfl-report-elf-align.c -index a4e97d3c..f471587c 100644 +index a4e97d3..f471587 100644 --- a/tests/dwfl-report-elf-align.c +++ b/tests/dwfl-report-elf-align.c @@ -20,7 +20,7 @@ @@ -807,7 +782,7 @@ index a4e97d3c..f471587c 100644 #include #include diff --git a/tests/dwfllines.c b/tests/dwfllines.c -index 90379dd2..cbdf6c4c 100644 +index 90379dd..cbdf6c4 100644 --- a/tests/dwfllines.c +++ b/tests/dwfllines.c @@ -27,7 +27,7 @@ @@ -820,7 +795,7 @@ index 90379dd2..cbdf6c4c 100644 int main (int argc, char *argv[]) diff --git a/tests/dwflmodtest.c b/tests/dwflmodtest.c -index 0027f96b..e68d3bca 100644 +index 0027f96..e68d3bc 100644 --- a/tests/dwflmodtest.c +++ b/tests/dwflmodtest.c @@ -23,7 +23,7 @@ @@ -833,7 +808,7 @@ index 0027f96b..e68d3bca 100644 #include #include ELFUTILS_HEADER(dwfl) diff --git a/tests/dwflsyms.c b/tests/dwflsyms.c -index 49ac3346..cf078301 100644 +index 49ac334..cf07830 100644 --- a/tests/dwflsyms.c +++ b/tests/dwflsyms.c @@ -25,7 +25,7 @@ @@ -846,7 +821,7 @@ index 49ac3346..cf078301 100644 static const char * diff --git a/tests/early-offscn.c b/tests/early-offscn.c -index 924cb9ef..6f60d5a3 100644 +index 924cb9e..6f60d5a 100644 --- a/tests/early-offscn.c +++ b/tests/early-offscn.c @@ -19,7 +19,7 @@ @@ -859,7 +834,7 @@ index 924cb9ef..6f60d5a3 100644 #include #include diff --git a/tests/ecp.c b/tests/ecp.c -index 38a6859e..743cea5d 100644 +index 38a6859..743cea5 100644 --- a/tests/ecp.c +++ b/tests/ecp.c @@ -20,7 +20,7 @@ @@ -872,7 +847,7 @@ index 38a6859e..743cea5d 100644 #include #include diff --git a/tests/find-prologues.c b/tests/find-prologues.c -index ba8ae371..76f5f047 100644 +index ba8ae37..76f5f04 100644 --- a/tests/find-prologues.c +++ b/tests/find-prologues.c @@ -25,7 +25,7 @@ @@ -885,7 +860,7 @@ index ba8ae371..76f5f047 100644 #include diff --git a/tests/funcretval.c b/tests/funcretval.c -index 8d19d117..c8aaa93d 100644 +index 8d19d11..c8aaa93 100644 --- a/tests/funcretval.c +++ b/tests/funcretval.c @@ -25,7 +25,7 @@ @@ -898,7 +873,7 @@ index 8d19d117..c8aaa93d 100644 #include diff --git a/tests/funcscopes.c b/tests/funcscopes.c -index 9c901858..dbccb89e 100644 +index 9c90185..dbccb89 100644 --- a/tests/funcscopes.c +++ b/tests/funcscopes.c @@ -25,7 +25,7 @@ @@ -911,7 +886,7 @@ index 9c901858..dbccb89e 100644 #include diff --git a/tests/getsrc_die.c b/tests/getsrc_die.c -index 055aede0..9c394dd0 100644 +index 055aede..9c394dd 100644 --- a/tests/getsrc_die.c +++ b/tests/getsrc_die.c @@ -19,7 +19,7 @@ @@ -924,7 +899,7 @@ index 055aede0..9c394dd0 100644 #include #include diff --git a/tests/line2addr.c b/tests/line2addr.c -index e0d65d3d..9bf0023b 100644 +index e0d65d3..9bf0023 100644 --- a/tests/line2addr.c +++ b/tests/line2addr.c @@ -26,7 +26,7 @@ @@ -937,7 +912,7 @@ index e0d65d3d..9bf0023b 100644 static void diff --git a/tests/low_high_pc.c b/tests/low_high_pc.c -index d0f43023..8da4fbdf 100644 +index 5c6b343..fa0c158 100644 --- a/tests/low_high_pc.c +++ b/tests/low_high_pc.c @@ -25,7 +25,7 @@ @@ -949,21 +924,8 @@ index d0f43023..8da4fbdf 100644 #include #include -diff --git a/tests/md5-sha1-test.c b/tests/md5-sha1-test.c -index d50355e9..3c41f40b 100644 ---- a/tests/md5-sha1-test.c -+++ b/tests/md5-sha1-test.c -@@ -19,7 +19,7 @@ - #endif - - #include --#include -+#include - - #include "md5.h" - #include "sha1.h" diff --git a/tests/rdwrmmap.c b/tests/rdwrmmap.c -index 6f027dfe..1ce5e6ed 100644 +index 6f027df..1ce5e6e 100644 --- a/tests/rdwrmmap.c +++ b/tests/rdwrmmap.c @@ -19,7 +19,7 @@ @@ -976,7 +938,7 @@ index 6f027dfe..1ce5e6ed 100644 #include #include diff --git a/tests/saridx.c b/tests/saridx.c -index 8a450d82..b3878013 100644 +index 8a450d8..b387801 100644 --- a/tests/saridx.c +++ b/tests/saridx.c @@ -17,7 +17,7 @@ @@ -989,7 +951,7 @@ index 8a450d82..b3878013 100644 #include #include diff --git a/tests/sectiondump.c b/tests/sectiondump.c -index 3033fedc..8e888db3 100644 +index 3033fed..8e888db 100644 --- a/tests/sectiondump.c +++ b/tests/sectiondump.c @@ -18,7 +18,7 @@ @@ -1002,7 +964,7 @@ index 3033fedc..8e888db3 100644 #include #include diff --git a/tests/varlocs.c b/tests/varlocs.c -index c3fba89e..e043ea2c 100644 +index f4a711c..1d89a61 100644 --- a/tests/varlocs.c +++ b/tests/varlocs.c @@ -25,7 +25,7 @@ @@ -1015,7 +977,7 @@ index c3fba89e..e043ea2c 100644 #include #include diff --git a/tests/vdsosyms.c b/tests/vdsosyms.c -index b876c10b..afb28232 100644 +index b876c10..afb2823 100644 --- a/tests/vdsosyms.c +++ b/tests/vdsosyms.c @@ -18,7 +18,7 @@ @@ -1027,3 +989,6 @@ index b876c10b..afb28232 100644 #include #include #include +-- +2.7.4 + diff --git a/meta/recipes-devtools/elfutils/files/debian/0001-Ignore-differences-between-mips-machine-identifiers.patch b/meta/recipes-devtools/elfutils/files/debian/0001-Ignore-differences-between-mips-machine-identifiers.patch index e0291b4cf3..a9a7210031 100644 --- a/meta/recipes-devtools/elfutils/files/debian/0001-Ignore-differences-between-mips-machine-identifiers.patch +++ b/meta/recipes-devtools/elfutils/files/debian/0001-Ignore-differences-between-mips-machine-identifiers.patch @@ -8,10 +8,6 @@ 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 - -Upstream-Status: Backport [from debian] -Signed-off-by: Hongxu Jia - --- backends/mips_init.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/meta/recipes-devtools/elfutils/files/debian/0001-arm_backend.patch b/meta/recipes-devtools/elfutils/files/debian/0001-arm_backend.patch new file mode 100644 index 0000000000..540ba95e0e --- /dev/null +++ b/meta/recipes-devtools/elfutils/files/debian/0001-arm_backend.patch @@ -0,0 +1,627 @@ +From a95f370bc2690c150c46f215543de278469900eb Mon Sep 17 00:00:00 2001 +From: Hongxu Jia +Date: Fri, 29 Jun 2018 15:42:39 +0800 +Subject: [PATCH] arm_backend + +Upstream-Status: Backport from debian +arm_backend.diff and rebase to 0.172 + +http://ftp.de.debian.org/debian/pool/main/e/elfutils/elfutils_0.170-0.5.debian.tar.xz + +Signed-off-by: Hongxu Jia +--- + 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 + +diff --git a/backends/arm_init.c b/backends/arm_init.c +index f2b1b11..1b71f16 100644 +--- a/backends/arm_init.c ++++ b/backends/arm_init.c +@@ -35,20 +35,31 @@ + #define RELOC_PREFIX R_ARM_ + #include "libebl_CPU.h" + ++#include "libebl_arm.h" ++ + /* This defines the common reloc hooks based on arm_reloc.def. */ + #include "common-reloc.c" + + + const char * +-arm_init (Elf *elf __attribute__ ((unused)), ++arm_init (Elf *elf, + GElf_Half machine __attribute__ ((unused)), + Ebl *eh, + size_t ehlen) + { ++ int soft_float = 0; ++ + /* Check whether the Elf_BH object has a sufficent size. */ + if (ehlen < sizeof (Ebl)) + return NULL; + ++ if (elf) { ++ GElf_Ehdr ehdr_mem; ++ GElf_Ehdr *ehdr = gelf_getehdr (elf, &ehdr_mem); ++ if (ehdr && (ehdr->e_flags & EF_ARM_SOFT_FLOAT)) ++ soft_float = 1; ++ } ++ + /* We handle it. */ + eh->name = "ARM"; + arm_init_reloc (eh); +@@ -60,7 +71,10 @@ arm_init (Elf *elf __attribute__ ((unused)), + HOOK (eh, core_note); + HOOK (eh, auxv_info); + HOOK (eh, check_object_attribute); +- HOOK (eh, return_value_location); ++ if (soft_float) ++ eh->return_value_location = arm_return_value_location_soft; ++ else ++ eh->return_value_location = arm_return_value_location_hard; + HOOK (eh, abi_cfi); + HOOK (eh, check_reloc_target_type); + HOOK (eh, symbol_type_name); +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 + + #include ++#include + #include + + #define BACKEND arm_ +@@ -76,6 +77,9 @@ arm_register_info (Ebl *ebl __attribute__ ((unused)), + break; + + case 16 + 0 ... 16 + 7: ++ /* AADWARF says that there are no registers in that range, ++ * but gcc maps FPA registers here ++ */ + regno += 96 - 16; + FALLTHROUGH; + case 96 + 0 ... 96 + 7: +@@ -87,11 +91,139 @@ arm_register_info (Ebl *ebl __attribute__ ((unused)), + namelen = 2; + break; + ++ case 64 + 0 ... 64 + 9: ++ *setname = "VFP"; ++ *bits = 32; ++ *type = DW_ATE_float; ++ name[0] = 's'; ++ name[1] = regno - 64 + '0'; ++ namelen = 2; ++ break; ++ ++ case 64 + 10 ... 64 + 31: ++ *setname = "VFP"; ++ *bits = 32; ++ *type = DW_ATE_float; ++ name[0] = 's'; ++ name[1] = (regno - 64) / 10 + '0'; ++ name[2] = (regno - 64) % 10 + '0'; ++ namelen = 3; ++ break; ++ ++ case 104 + 0 ... 104 + 7: ++ /* XXX TODO: ++ * This can be either intel wireless MMX general purpose/control ++ * registers or xscale accumulator, which have different usage. ++ * We only have the intel wireless MMX here now. ++ * The name needs to be changed for the xscale accumulator too. */ ++ *setname = "MMX"; ++ *type = DW_ATE_unsigned; ++ *bits = 32; ++ memcpy(name, "wcgr", 4); ++ name[4] = regno - 104 + '0'; ++ namelen = 5; ++ break; ++ ++ case 112 + 0 ... 112 + 9: ++ *setname = "MMX"; ++ *type = DW_ATE_unsigned; ++ *bits = 64; ++ name[0] = 'w'; ++ name[1] = 'r'; ++ name[2] = regno - 112 + '0'; ++ namelen = 3; ++ break; ++ ++ case 112 + 10 ... 112 + 15: ++ *setname = "MMX"; ++ *type = DW_ATE_unsigned; ++ *bits = 64; ++ name[0] = 'w'; ++ name[1] = 'r'; ++ name[2] = '1'; ++ name[3] = regno - 112 - 10 + '0'; ++ namelen = 4; ++ break; ++ + case 128: ++ *setname = "state"; + *type = DW_ATE_unsigned; + return stpcpy (name, "spsr") + 1 - name; + ++ case 129: ++ *setname = "state"; ++ *type = DW_ATE_unsigned; ++ return stpcpy(name, "spsr_fiq") + 1 - name; ++ ++ case 130: ++ *setname = "state"; ++ *type = DW_ATE_unsigned; ++ return stpcpy(name, "spsr_irq") + 1 - name; ++ ++ case 131: ++ *setname = "state"; ++ *type = DW_ATE_unsigned; ++ return stpcpy(name, "spsr_abt") + 1 - name; ++ ++ case 132: ++ *setname = "state"; ++ *type = DW_ATE_unsigned; ++ return stpcpy(name, "spsr_und") + 1 - name; ++ ++ case 133: ++ *setname = "state"; ++ *type = DW_ATE_unsigned; ++ return stpcpy(name, "spsr_svc") + 1 - name; ++ ++ case 144 ... 150: ++ *setname = "integer"; ++ *type = DW_ATE_signed; ++ *bits = 32; ++ return sprintf(name, "r%d_usr", regno - 144 + 8) + 1; ++ ++ case 151 ... 157: ++ *setname = "integer"; ++ *type = DW_ATE_signed; ++ *bits = 32; ++ return sprintf(name, "r%d_fiq", regno - 151 + 8) + 1; ++ ++ case 158 ... 159: ++ *setname = "integer"; ++ *type = DW_ATE_signed; ++ *bits = 32; ++ return sprintf(name, "r%d_irq", regno - 158 + 13) + 1; ++ ++ case 160 ... 161: ++ *setname = "integer"; ++ *type = DW_ATE_signed; ++ *bits = 32; ++ return sprintf(name, "r%d_abt", regno - 160 + 13) + 1; ++ ++ case 162 ... 163: ++ *setname = "integer"; ++ *type = DW_ATE_signed; ++ *bits = 32; ++ return sprintf(name, "r%d_und", regno - 162 + 13) + 1; ++ ++ case 164 ... 165: ++ *setname = "integer"; ++ *type = DW_ATE_signed; ++ *bits = 32; ++ return sprintf(name, "r%d_svc", regno - 164 + 13) + 1; ++ ++ case 192 ... 199: ++ *setname = "MMX"; ++ *bits = 32; ++ *type = DW_ATE_unsigned; ++ name[0] = 'w'; ++ name[1] = 'c'; ++ name[2] = regno - 192 + '0'; ++ namelen = 3; ++ break; ++ + case 256 + 0 ... 256 + 9: ++ /* XXX TODO: Neon also uses those registers and can contain ++ * both float and integers */ + *setname = "VFP"; + *type = DW_ATE_float; + *bits = 64; +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)) + ++/* f1 */ /* XXX TODO: f0 can also have number 96 if program was compiled with -mabi=aapcs */ ++static const Dwarf_Op loc_fpreg[] = ++ { ++ { .atom = DW_OP_reg16 }, ++ }; ++#define nloc_fpreg 1 ++ + /* The return value is a structure and is actually stored in stack space + passed in a hidden argument by the caller. But, the compiler + helpfully returns the address of that space in r0. */ +@@ -58,8 +65,9 @@ static const Dwarf_Op loc_aggregate[] = + #define nloc_aggregate 1 + + +-int +-arm_return_value_location (Dwarf_Die *functypedie, const Dwarf_Op **locp) ++static int ++arm_return_value_location_ (Dwarf_Die *functypedie, const Dwarf_Op **locp, ++ int soft_float) + { + /* 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 *functypedie, const Dwarf_Op **locp) + else + return -1; + } ++ if (tag == DW_TAG_base_type) ++ { ++ Dwarf_Word encoding; ++ if (dwarf_formudata (dwarf_attr_integrate (typedie, DW_AT_encoding, ++ &attr_mem), &encoding) != 0) ++ return -1; ++ ++ if ((encoding == DW_ATE_float) && !soft_float) ++ { ++ *locp = loc_fpreg; ++ if (size <= 8) ++ return nloc_fpreg; ++ goto aggregate; ++ } ++ } + if (size <= 16) + { + intreg: +@@ -106,6 +129,7 @@ arm_return_value_location (Dwarf_Die *functypedie, const Dwarf_Op **locp) + } + + aggregate: ++ /* XXX TODO sometimes aggregates are returned in r0 (-mabi=aapcs) */ + *locp = loc_aggregate; + return nloc_aggregate; + } +@@ -125,3 +149,18 @@ arm_return_value_location (Dwarf_Die *functypedie, const Dwarf_Op **locp) + DWARF and might be valid. */ + return -2; + } ++ ++/* return location for -mabi=apcs-gnu -msoft-float */ ++int ++arm_return_value_location_soft (Dwarf_Die *functypedie, const Dwarf_Op **locp) ++{ ++ return arm_return_value_location_ (functypedie, locp, 1); ++} ++ ++/* return location for -mabi=apcs-gnu -mhard-float (current default) */ ++int ++arm_return_value_location_hard (Dwarf_Die *functypedie, const Dwarf_Op **locp) ++{ ++ return arm_return_value_location_ (functypedie, locp, 0); ++} ++ +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 ++ ++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 6c9f61e..6d82fef 100644 +--- a/libelf/elf.h ++++ b/libelf/elf.h +@@ -2692,6 +2692,9 @@ enum + #define EF_ARM_EABI_VER4 0x04000000 + #define EF_ARM_EABI_VER5 0x05000000 + ++/* EI_OSABI values */ ++#define ELFOSABI_ARM_AEABI 64 /* Contains symbol versioning. */ ++ + /* Additional symbol types for Thumb. */ + #define STT_ARM_TFUNC STT_LOPROC /* A Thumb function. */ + #define STT_ARM_16BIT STT_HIPROC /* A Thumb label. */ +@@ -2709,12 +2712,19 @@ enum + + /* Processor specific values for the Phdr p_type field. */ + #define PT_ARM_EXIDX (PT_LOPROC + 1) /* ARM unwind segment. */ ++#define PT_ARM_UNWIND PT_ARM_EXIDX + + /* Processor specific values for the Shdr sh_type field. */ + #define SHT_ARM_EXIDX (SHT_LOPROC + 1) /* ARM unwind section. */ + #define SHT_ARM_PREEMPTMAP (SHT_LOPROC + 2) /* Preemption details. */ + #define SHT_ARM_ATTRIBUTES (SHT_LOPROC + 3) /* ARM attributes section. */ + ++/* Processor specific values for the Dyn d_tag field. */ ++#define DT_ARM_RESERVED1 (DT_LOPROC + 0) ++#define DT_ARM_SYMTABSZ (DT_LOPROC + 1) ++#define DT_ARM_PREEMTMAB (DT_LOPROC + 2) ++#define DT_ARM_RESERVED2 (DT_LOPROC + 3) ++#define DT_ARM_NUM 4 + + /* AArch64 relocs. */ + +@@ -3007,6 +3017,7 @@ enum + TLS block (LDR, STR). */ + #define R_ARM_TLS_IE12GP 111 /* 12 bit GOT entry relative + to GOT origin (LDR). */ ++/* 112 - 127 private range */ + #define R_ARM_ME_TOO 128 /* Obsolete. */ + #define R_ARM_THM_TLS_DESCSEQ 129 + #define R_ARM_THM_TLS_DESCSEQ16 129 +diff --git a/tests/run-addrcfi.sh b/tests/run-addrcfi.sh +index fd89d02..462d7c5 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 7ddd452..a31dba4 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 + 15: pc (pc), address 32 bits +- 128: spsr (spsr), unsigned 32 bits ++ 144: r8_usr (r8_usr), signed 32 bits ++ 145: r9_usr (r9_usr), signed 32 bits ++ 146: r10_usr (r10_usr), signed 32 bits ++ 147: r11_usr (r11_usr), signed 32 bits ++ 148: r12_usr (r12_usr), signed 32 bits ++ 149: r13_usr (r13_usr), signed 32 bits ++ 150: r14_usr (r14_usr), signed 32 bits ++ 151: r8_fiq (r8_fiq), signed 32 bits ++ 152: r9_fiq (r9_fiq), signed 32 bits ++ 153: r10_fiq (r10_fiq), signed 32 bits ++ 154: r11_fiq (r11_fiq), signed 32 bits ++ 155: r12_fiq (r12_fiq), signed 32 bits ++ 156: r13_fiq (r13_fiq), signed 32 bits ++ 157: r14_fiq (r14_fiq), signed 32 bits ++ 158: r13_irq (r13_irq), signed 32 bits ++ 159: r14_irq (r14_irq), signed 32 bits ++ 160: r13_abt (r13_abt), signed 32 bits ++ 161: r14_abt (r14_abt), signed 32 bits ++ 162: r13_und (r13_und), signed 32 bits ++ 163: r14_und (r14_und), signed 32 bits ++ 164: r13_svc (r13_svc), signed 32 bits ++ 165: r14_svc (r14_svc), signed 32 bits + FPA registers: + 16: f0 (f0), float 96 bits + 17: f1 (f1), float 96 bits +@@ -2690,7 +2711,72 @@ FPA registers: + 101: f5 (f5), float 96 bits + 102: f6 (f6), float 96 bits + 103: f7 (f7), float 96 bits ++MMX registers: ++ 104: wcgr0 (wcgr0), unsigned 32 bits ++ 105: wcgr1 (wcgr1), unsigned 32 bits ++ 106: wcgr2 (wcgr2), unsigned 32 bits ++ 107: wcgr3 (wcgr3), unsigned 32 bits ++ 108: wcgr4 (wcgr4), unsigned 32 bits ++ 109: wcgr5 (wcgr5), unsigned 32 bits ++ 110: wcgr6 (wcgr6), unsigned 32 bits ++ 111: wcgr7 (wcgr7), unsigned 32 bits ++ 112: wr0 (wr0), unsigned 64 bits ++ 113: wr1 (wr1), unsigned 64 bits ++ 114: wr2 (wr2), unsigned 64 bits ++ 115: wr3 (wr3), unsigned 64 bits ++ 116: wr4 (wr4), unsigned 64 bits ++ 117: wr5 (wr5), unsigned 64 bits ++ 118: wr6 (wr6), unsigned 64 bits ++ 119: wr7 (wr7), unsigned 64 bits ++ 120: wr8 (wr8), unsigned 64 bits ++ 121: wr9 (wr9), unsigned 64 bits ++ 122: wr10 (wr10), unsigned 64 bits ++ 123: wr11 (wr11), unsigned 64 bits ++ 124: wr12 (wr12), unsigned 64 bits ++ 125: wr13 (wr13), unsigned 64 bits ++ 126: wr14 (wr14), unsigned 64 bits ++ 127: wr15 (wr15), unsigned 64 bits ++ 192: wc0 (wc0), unsigned 32 bits ++ 193: wc1 (wc1), unsigned 32 bits ++ 194: wc2 (wc2), unsigned 32 bits ++ 195: wc3 (wc3), unsigned 32 bits ++ 196: wc4 (wc4), unsigned 32 bits ++ 197: wc5 (wc5), unsigned 32 bits ++ 198: wc6 (wc6), unsigned 32 bits ++ 199: wc7 (wc7), unsigned 32 bits + VFP registers: ++ 64: s0 (s0), float 32 bits ++ 65: s1 (s1), float 32 bits ++ 66: s2 (s2), float 32 bits ++ 67: s3 (s3), float 32 bits ++ 68: s4 (s4), float 32 bits ++ 69: s5 (s5), float 32 bits ++ 70: s6 (s6), float 32 bits ++ 71: s7 (s7), float 32 bits ++ 72: s8 (s8), float 32 bits ++ 73: s9 (s9), float 32 bits ++ 74: s10 (s10), float 32 bits ++ 75: s11 (s11), float 32 bits ++ 76: s12 (s12), float 32 bits ++ 77: s13 (s13), float 32 bits ++ 78: s14 (s14), float 32 bits ++ 79: s15 (s15), float 32 bits ++ 80: s16 (s16), float 32 bits ++ 81: s17 (s17), float 32 bits ++ 82: s18 (s18), float 32 bits ++ 83: s19 (s19), float 32 bits ++ 84: s20 (s20), float 32 bits ++ 85: s21 (s21), float 32 bits ++ 86: s22 (s22), float 32 bits ++ 87: s23 (s23), float 32 bits ++ 88: s24 (s24), float 32 bits ++ 89: s25 (s25), float 32 bits ++ 90: s26 (s26), float 32 bits ++ 91: s27 (s27), float 32 bits ++ 92: s28 (s28), float 32 bits ++ 93: s29 (s29), float 32 bits ++ 94: s30 (s30), float 32 bits ++ 95: s31 (s31), float 32 bits + 256: d0 (d0), float 64 bits + 257: d1 (d1), float 64 bits + 258: d2 (d2), float 64 bits +@@ -2723,6 +2809,13 @@ VFP registers: + 285: d29 (d29), float 64 bits + 286: d30 (d30), float 64 bits + 287: d31 (d31), float 64 bits ++state registers: ++ 128: spsr (spsr), unsigned 32 bits ++ 129: spsr_fiq (spsr_fiq), unsigned 32 bits ++ 130: spsr_irq (spsr_irq), unsigned 32 bits ++ 131: spsr_abt (spsr_abt), unsigned 32 bits ++ 132: spsr_und (spsr_und), unsigned 32 bits ++ 133: spsr_svc (spsr_svc), unsigned 32 bits + EOF + + # See run-readelf-mixed-corenote.sh for instructions to regenerate +diff --git a/tests/run-readelf-mixed-corenote.sh b/tests/run-readelf-mixed-corenote.sh +index 86171c4..018612f 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 +- r0: 1 r1: -1091672508 r2: -1091672500 +- r3: 0 r4: 0 r5: 0 +- r6: 33728 r7: 0 r8: 0 +- r9: 0 r10: -1225703496 r11: -1091672844 +- r12: 0 sp: 0xbeee64f4 lr: 0xb6dc3f48 +- pc: 0x00008500 spsr: 0x60000010 ++ r0: 1 r1: -1091672508 r2: -1091672500 r3: 0 ++ r4: 0 r5: 0 r6: 33728 r7: 0 ++ r8: 0 r9: 0 r10: -1225703496 r11: -1091672844 ++ r12: 0 sp: 0xbeee64f4 lr: 0xb6dc3f48 pc: 0x00008500 ++ spsr: 0x60000010 + 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 +-- +2.7.4 + diff --git a/meta/recipes-devtools/elfutils/files/debian/0001-disable_werror.patch b/meta/recipes-devtools/elfutils/files/debian/0001-disable_werror.patch new file mode 100644 index 0000000000..66de238418 --- /dev/null +++ b/meta/recipes-devtools/elfutils/files/debian/0001-disable_werror.patch @@ -0,0 +1,35 @@ +From 5d45565e71ddab3d7848077b61eb0ca73c0bcbcc Mon Sep 17 00:00:00 2001 +From: Hongxu Jia +Date: Fri, 29 Jun 2018 16:01:14 +0800 +Subject: [PATCH] disable -Werror as it tends to break with new gcc versions + +Bug-Debian: https://bugs.debian.org/886004 +Last-Update: 2018-01-01 + +Signed-off-by: Helmut Grohne + +Upstream-Status: Backport from debian +mdisable_werror.patc and rebase to 0.172 + +http://ftp.de.debian.org/debian/pool/main/e/elfutils/elfutils_0.170-0.5.debian.tar.xz + +Signed-off-by: Hongxu Jia +--- + config/eu.am | 1 - + 1 file changed, 1 deletion(-) + +diff --git a/config/eu.am b/config/eu.am +index c2cc349..99b368e 100644 +--- a/config/eu.am ++++ b/config/eu.am +@@ -73,7 +73,6 @@ AM_CFLAGS = -std=gnu99 -Wall -Wshadow -Wformat=2 \ + -Wold-style-definition -Wstrict-prototypes \ + $(LOGICAL_OP_WARNING) $(DUPLICATED_COND_WARNING) \ + $(NULL_DEREFERENCE_WARNING) $(IMPLICIT_FALLTHROUGH_WARNING) \ +- $(if $($(*F)_no_Werror),,-Werror) \ + $(if $($(*F)_no_Wunused),,-Wunused -Wextra) \ + $(if $($(*F)_no_Wstack_usage),,$(STACK_USAGE_WARNING)) \ + $(if $($(*F)_no_Wpacked_not_aligned),-Wno-packed-not-aligned,) \ +-- +2.7.4 + diff --git a/meta/recipes-devtools/elfutils/files/debian/0001-fix-gcc7-ftbfs.patch b/meta/recipes-devtools/elfutils/files/debian/0001-fix-gcc7-ftbfs.patch new file mode 100644 index 0000000000..226ec7f530 --- /dev/null +++ b/meta/recipes-devtools/elfutils/files/debian/0001-fix-gcc7-ftbfs.patch @@ -0,0 +1,57 @@ +From 91c0a0da2a8932f163d57db5d9d847bed6822502 Mon Sep 17 00:00:00 2001 +From: Hongxu Jia +Date: Fri, 29 Jun 2018 15:59:57 +0800 +Subject: [PATCH] fix gcc7 ftbfs + +Upstream-Status: Backport from debian +fix-gcc7-ftbfs.diff and rebase to 0.172 + +http://ftp.de.debian.org/debian/pool/main/e/elfutils/elfutils_0.170-0.5.debian.tar.xz + +Signed-off-by: Hongxu Jia +--- + backends/mips_retval.c | 1 + + backends/parisc_retval.c | 1 + + src/ar.c | 2 +- + 3 files changed, 3 insertions(+), 1 deletion(-) + +diff --git a/backends/mips_retval.c b/backends/mips_retval.c +index 57487bb..e7973a8 100644 +--- a/backends/mips_retval.c ++++ b/backends/mips_retval.c +@@ -390,6 +390,7 @@ mips_return_value_location (Dwarf_Die *functypedie, const Dwarf_Op **locp) + } + + /* Fallthrough to handle large types */ ++ /* Fall through. */ + + case DW_TAG_array_type: + large: +diff --git a/backends/parisc_retval.c b/backends/parisc_retval.c +index df7ec3a..988e1fe 100644 +--- a/backends/parisc_retval.c ++++ b/backends/parisc_retval.c +@@ -167,6 +167,7 @@ parisc_return_value_location_ (Dwarf_Die *functypedie, const Dwarf_Op **locp, in + + /* Else fall through. */ + } ++ /* Fall through. */ + + case DW_TAG_structure_type: + case DW_TAG_class_type: +diff --git a/src/ar.c b/src/ar.c +index 818115b..c77e9f4 100644 +--- a/src/ar.c ++++ b/src/ar.c +@@ -1073,7 +1073,7 @@ do_oper_delete (const char *arfname, char **argv, int argc, + static bool + no0print (bool ofmt, char *buf, int bufsize, long int val) + { +- char tmpbuf[bufsize + 1]; ++ char tmpbuf[bufsize + 1 + 4]; + int ret = snprintf (tmpbuf, sizeof (tmpbuf), ofmt ? "%-*lo" : "%-*ld", + bufsize, val); + if (ret >= (int) sizeof (tmpbuf)) +-- +2.7.4 + diff --git a/meta/recipes-devtools/elfutils/files/debian/0001-hppa_backend.patch b/meta/recipes-devtools/elfutils/files/debian/0001-hppa_backend.patch new file mode 100644 index 0000000000..c0dbed798d --- /dev/null +++ b/meta/recipes-devtools/elfutils/files/debian/0001-hppa_backend.patch @@ -0,0 +1,840 @@ +From c510c6c8523246dd79c6ea28d1646b153c23e491 Mon Sep 17 00:00:00 2001 +From: Hongxu Jia +Date: Fri, 29 Jun 2018 15:39:46 +0800 +Subject: [PATCH] hppa_backend + +Upstream-Status: Backport from debian +hppa_backend.diff and rebase to 0.172 + +http://ftp.de.debian.org/debian/pool/main/e/elfutils/elfutils_0.170-0.5.debian.tar.xz +Signed-off-by: Hongxu Jia +--- + backends/Makefile.am | 9 +- + 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 | 112 ++++++++++++++++++++++++ + libelf/elf.h | 11 +++ + 8 files changed, 711 insertions(+), 3 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 80aa00e..1e4b8e9 100644 +--- a/backends/Makefile.am ++++ b/backends/Makefile.am +@@ -33,16 +33,16 @@ AM_CPPFLAGS += -I$(top_srcdir)/libebl -I$(top_srcdir)/libasm \ + + + 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) + +- + libelf = ../libelf/libelf.so + libdw = ../libdw/libdw.so + libeu = ../lib/libeu.a +@@ -135,6 +135,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) +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 ++ ++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 ++++ b/backends/parisc_init.c +@@ -0,0 +1,73 @@ ++/* Initialization of PA-RISC specific backend library. ++ Copyright (C) 2002, 2005, 2006 Red Hat, Inc. ++ This file is part of Red Hat elfutils. ++ Written by Ulrich Drepper , 2002. ++ ++ Red Hat elfutils is free software; you can redistribute it and/or modify ++ it under the terms of the GNU General Public License as published by the ++ Free Software Foundation; version 2 of the License. ++ ++ Red Hat 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 a copy of the GNU General Public License along ++ with Red Hat elfutils; if not, write to the Free Software Foundation, ++ Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301 USA. ++ ++ Red Hat elfutils is an included package of the Open Invention Network. ++ An included package of the Open Invention Network is a package for which ++ Open Invention Network licensees cross-license their patents. No patent ++ license is granted, either expressly or impliedly, by designation as an ++ included package. Should you wish to participate in the Open Invention ++ Network licensing program, please visit www.openinventionnetwork.com ++ . */ ++ ++#ifdef HAVE_CONFIG_H ++# include ++#endif ++ ++#define BACKEND parisc_ ++#define RELOC_PREFIX R_PARISC_ ++#include "libebl_CPU.h" ++#include "libebl_parisc.h" ++ ++/* This defines the common reloc hooks based on parisc_reloc.def. */ ++#include "common-reloc.c" ++ ++ ++const char * ++parisc_init (Elf *elf __attribute__ ((unused)), ++ GElf_Half machine __attribute__ ((unused)), ++ Ebl *eh, ++ size_t ehlen) ++{ ++ int pa64 = 0; ++ ++ /* Check whether the Elf_BH object has a sufficent size. */ ++ if (ehlen < sizeof (Ebl)) ++ return NULL; ++ ++ if (elf) { ++ GElf_Ehdr ehdr_mem; ++ GElf_Ehdr *ehdr = gelf_getehdr (elf, &ehdr_mem); ++ if (ehdr && (ehdr->e_flags & EF_PARISC_WIDE)) ++ pa64 = 1; ++ } ++ /* We handle it. */ ++ eh->name = "PA-RISC"; ++ parisc_init_reloc (eh); ++ HOOK (eh, reloc_simple_type); ++ HOOK (eh, machine_flag_check); ++ HOOK (eh, symbol_type_name); ++ HOOK (eh, segment_type_name); ++ HOOK (eh, section_type_name); ++ HOOK (eh, register_info); ++ if (pa64) ++ eh->return_value_location = parisc_return_value_location_64; ++ else ++ eh->return_value_location = parisc_return_value_location_32; ++ ++ return MODVERSION; ++} +diff --git a/backends/parisc_regs.c b/backends/parisc_regs.c +new file mode 100644 +index 0000000..3895f8e +--- /dev/null ++++ b/backends/parisc_regs.c +@@ -0,0 +1,159 @@ ++/* Register names and numbers for PA-RISC DWARF. ++ Copyright (C) 2005, 2006 Red Hat, Inc. ++ This file is part of Red Hat elfutils. ++ ++ Red Hat elfutils is free software; you can redistribute it and/or modify ++ it under the terms of the GNU General Public License as published by the ++ Free Software Foundation; version 2 of the License. ++ ++ Red Hat 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 a copy of the GNU General Public License along ++ with Red Hat elfutils; if not, write to the Free Software Foundation, ++ Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301 USA. ++ ++ Red Hat elfutils is an included package of the Open Invention Network. ++ An included package of the Open Invention Network is a package for which ++ Open Invention Network licensees cross-license their patents. No patent ++ license is granted, either expressly or impliedly, by designation as an ++ included package. Should you wish to participate in the Open Invention ++ Network licensing program, please visit www.openinventionnetwork.com ++ . */ ++ ++#ifdef HAVE_CONFIG_H ++# include ++#endif ++ ++#include ++#include ++ ++#define BACKEND parisc_ ++#include "libebl_CPU.h" ++ ++ssize_t ++parisc_register_info (Ebl *ebl, int regno, char *name, size_t namelen, ++ const char **prefix, const char **setname, ++ int *bits, int *type) ++{ ++ int pa64 = 0; ++ ++ if (ebl->elf) { ++ GElf_Ehdr ehdr_mem; ++ GElf_Ehdr *ehdr = gelf_getehdr (ebl->elf, &ehdr_mem); ++ if (ehdr->e_flags & EF_PARISC_WIDE) ++ pa64 = 1; ++ } ++ ++ int nregs = pa64 ? 127 : 128; ++ ++ if (name == NULL) ++ return nregs; ++ ++ if (regno < 0 || regno >= nregs || namelen < 6) ++ return -1; ++ ++ *prefix = "%"; ++ ++ if (regno < 32) ++ { ++ *setname = "integer"; ++ *type = DW_ATE_signed; ++ if (pa64) ++ { ++ *bits = 64; ++ } ++ else ++ { ++ *bits = 32; ++ } ++ } ++ else if (regno == 32) ++ { ++ *setname = "special"; ++ if (pa64) ++ { ++ *bits = 6; ++ } ++ else ++ { ++ *bits = 5; ++ } ++ *type = DW_ATE_unsigned; ++ } ++ else ++ { ++ *setname = "FPU"; ++ *type = DW_ATE_float; ++ if (pa64) ++ { ++ *bits = 64; ++ } ++ else ++ { ++ *bits = 32; ++ } ++ } ++ ++ if (regno < 33) { ++ switch (regno) ++ { ++ case 0 ... 9: ++ name[0] = 'r'; ++ name[1] = regno + '0'; ++ namelen = 2; ++ break; ++ case 10 ... 31: ++ name[0] = 'r'; ++ name[1] = regno / 10 + '0'; ++ name[2] = regno % 10 + '0'; ++ namelen = 3; ++ break; ++ case 32: ++ *prefix = NULL; ++ name[0] = 'S'; ++ name[1] = 'A'; ++ name[2] = 'R'; ++ namelen = 3; ++ break; ++ } ++ } ++ else { ++ if (pa64 && ((regno - 72) % 2)) { ++ *setname = NULL; ++ return 0; ++ } ++ ++ switch (regno) ++ { ++ case 72 + 0 ... 72 + 11: ++ name[0] = 'f'; ++ name[1] = 'r'; ++ name[2] = (regno + 8 - 72) / 2 + '0'; ++ namelen = 3; ++ if ((regno + 8 - 72) % 2) { ++ name[3] = 'R'; ++ namelen++; ++ } ++ break; ++ case 72 + 12 ... 72 + 55: ++ name[0] = 'f'; ++ name[1] = 'r'; ++ name[2] = (regno + 8 - 72) / 2 / 10 + '0'; ++ name[3] = (regno + 8 - 72) / 2 % 10 + '0'; ++ namelen = 4; ++ if ((regno + 8 - 72) % 2) { ++ name[4] = 'R'; ++ namelen++; ++ } ++ break; ++ default: ++ *setname = NULL; ++ return 0; ++ } ++ } ++ name[namelen++] = '\0'; ++ return namelen; ++} +diff --git a/backends/parisc_reloc.def b/backends/parisc_reloc.def +new file mode 100644 +index 0000000..1f875ba +--- /dev/null ++++ b/backends/parisc_reloc.def +@@ -0,0 +1,128 @@ ++/* List the relocation types for PA-RISC. -*- C -*- ++ Copyright (C) 2005 Red Hat, Inc. ++ This file is part of Red Hat elfutils. ++ ++ Red Hat elfutils is free software; you can redistribute it and/or modify ++ it under the terms of the GNU General Public License as published by the ++ Free Software Foundation; version 2 of the License. ++ ++ Red Hat 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 a copy of the GNU General Public License along ++ with Red Hat elfutils; if not, write to the Free Software Foundation, ++ Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301 USA. ++ ++ Red Hat elfutils is an included package of the Open Invention Network. ++ An included package of the Open Invention Network is a package for which ++ Open Invention Network licensees cross-license their patents. No patent ++ license is granted, either expressly or impliedly, by designation as an ++ included package. Should you wish to participate in the Open Invention ++ Network licensing program, please visit www.openinventionnetwork.com ++ . */ ++ ++/* NAME, REL|EXEC|DYN */ ++ ++RELOC_TYPE (NONE, EXEC|DYN) ++RELOC_TYPE (DIR32, REL|EXEC|DYN) ++RELOC_TYPE (DIR21L, REL|EXEC|DYN) ++RELOC_TYPE (DIR17R, REL) ++RELOC_TYPE (DIR17F, REL) ++RELOC_TYPE (DIR14R, REL|DYN) ++RELOC_TYPE (PCREL32, REL) ++RELOC_TYPE (PCREL21L, REL) ++RELOC_TYPE (PCREL17R, REL) ++RELOC_TYPE (PCREL17F, REL) ++RELOC_TYPE (PCREL14R, REL|EXEC) ++RELOC_TYPE (DPREL21L, REL) ++RELOC_TYPE (DPREL14WR, REL) ++RELOC_TYPE (DPREL14DR, REL) ++RELOC_TYPE (DPREL14R, REL) ++RELOC_TYPE (GPREL21L, 0) ++RELOC_TYPE (GPREL14R, 0) ++RELOC_TYPE (LTOFF21L, REL) ++RELOC_TYPE (LTOFF14R, REL) ++RELOC_TYPE (DLTIND14F, 0) ++RELOC_TYPE (SETBASE, 0) ++RELOC_TYPE (SECREL32, REL) ++RELOC_TYPE (BASEREL21L, 0) ++RELOC_TYPE (BASEREL17R, 0) ++RELOC_TYPE (BASEREL14R, 0) ++RELOC_TYPE (SEGBASE, 0) ++RELOC_TYPE (SEGREL32, REL) ++RELOC_TYPE (PLTOFF21L, 0) ++RELOC_TYPE (PLTOFF14R, 0) ++RELOC_TYPE (PLTOFF14F, 0) ++RELOC_TYPE (LTOFF_FPTR32, 0) ++RELOC_TYPE (LTOFF_FPTR21L, 0) ++RELOC_TYPE (LTOFF_FPTR14R, 0) ++RELOC_TYPE (FPTR64, 0) ++RELOC_TYPE (PLABEL32, REL|DYN) ++RELOC_TYPE (PCREL64, 0) ++RELOC_TYPE (PCREL22C, 0) ++RELOC_TYPE (PCREL22F, 0) ++RELOC_TYPE (PCREL14WR, 0) ++RELOC_TYPE (PCREL14DR, 0) ++RELOC_TYPE (PCREL16F, 0) ++RELOC_TYPE (PCREL16WF, 0) ++RELOC_TYPE (PCREL16DF, 0) ++RELOC_TYPE (DIR64, REL|DYN) ++RELOC_TYPE (DIR14WR, REL) ++RELOC_TYPE (DIR14DR, REL) ++RELOC_TYPE (DIR16F, REL) ++RELOC_TYPE (DIR16WF, REL) ++RELOC_TYPE (DIR16DF, REL) ++RELOC_TYPE (GPREL64, 0) ++RELOC_TYPE (GPREL14WR, 0) ++RELOC_TYPE (GPREL14DR, 0) ++RELOC_TYPE (GPREL16F, 0) ++RELOC_TYPE (GPREL16WF, 0) ++RELOC_TYPE (GPREL16DF, 0) ++RELOC_TYPE (LTOFF64, 0) ++RELOC_TYPE (LTOFF14WR, 0) ++RELOC_TYPE (LTOFF14DR, 0) ++RELOC_TYPE (LTOFF16F, 0) ++RELOC_TYPE (LTOFF16WF, 0) ++RELOC_TYPE (LTOFF16DF, 0) ++RELOC_TYPE (SECREL64, 0) ++RELOC_TYPE (BASEREL14WR, 0) ++RELOC_TYPE (BASEREL14DR, 0) ++RELOC_TYPE (SEGREL64, 0) ++RELOC_TYPE (PLTOFF14WR, 0) ++RELOC_TYPE (PLTOFF14DR, 0) ++RELOC_TYPE (PLTOFF16F, 0) ++RELOC_TYPE (PLTOFF16WF, 0) ++RELOC_TYPE (PLTOFF16DF, 0) ++RELOC_TYPE (LTOFF_FPTR64, 0) ++RELOC_TYPE (LTOFF_FPTR14WR, 0) ++RELOC_TYPE (LTOFF_FPTR14DR, 0) ++RELOC_TYPE (LTOFF_FPTR16F, 0) ++RELOC_TYPE (LTOFF_FPTR16WF, 0) ++RELOC_TYPE (LTOFF_FPTR16DF, 0) ++RELOC_TYPE (COPY, EXEC) ++RELOC_TYPE (IPLT, EXEC|DYN) ++RELOC_TYPE (EPLT, 0) ++RELOC_TYPE (TPREL32, DYN) ++RELOC_TYPE (TPREL21L, 0) ++RELOC_TYPE (TPREL14R, 0) ++RELOC_TYPE (LTOFF_TP21L, 0) ++RELOC_TYPE (LTOFF_TP14R, 0) ++RELOC_TYPE (LTOFF_TP14F, 0) ++RELOC_TYPE (TPREL64, 0) ++RELOC_TYPE (TPREL14WR, 0) ++RELOC_TYPE (TPREL14DR, 0) ++RELOC_TYPE (TPREL16F, 0) ++RELOC_TYPE (TPREL16WF, 0) ++RELOC_TYPE (TPREL16DF, 0) ++RELOC_TYPE (LTOFF_TP64, 0) ++RELOC_TYPE (LTOFF_TP14WR, 0) ++RELOC_TYPE (LTOFF_TP14DR, 0) ++RELOC_TYPE (LTOFF_TP16F, 0) ++RELOC_TYPE (LTOFF_TP16WF, 0) ++RELOC_TYPE (LTOFF_TP16DF, 0) ++RELOC_TYPE (TLS_DTPMOD32, DYN) ++RELOC_TYPE (TLS_DTPMOD64, DYN) ++ ++#define NO_RELATIVE_RELOC 1 +diff --git a/backends/parisc_retval.c b/backends/parisc_retval.c +new file mode 100644 +index 0000000..df7ec3a +--- /dev/null ++++ b/backends/parisc_retval.c +@@ -0,0 +1,213 @@ ++/* Function return value location for Linux/PA-RISC ABI. ++ Copyright (C) 2005 Red Hat, Inc. ++ This file is part of Red Hat elfutils. ++ ++ Red Hat elfutils is free software; you can redistribute it and/or modify ++ it under the terms of the GNU General Public License as published by the ++ Free Software Foundation; version 2 of the License. ++ ++ Red Hat 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 a copy of the GNU General Public License along ++ with Red Hat elfutils; if not, write to the Free Software Foundation, ++ Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301 USA. ++ ++ Red Hat elfutils is an included package of the Open Invention Network. ++ An included package of the Open Invention Network is a package for which ++ Open Invention Network licensees cross-license their patents. No patent ++ license is granted, either expressly or impliedly, by designation as an ++ included package. Should you wish to participate in the Open Invention ++ Network licensing program, please visit www.openinventionnetwork.com ++ . */ ++ ++#ifdef HAVE_CONFIG_H ++# include ++#endif ++ ++#include ++#include ++ ++#define BACKEND parisc_ ++#include "libebl_CPU.h" ++#include "libebl_parisc.h" ++ ++/* %r28, or pair %r28, %r29. */ ++static const Dwarf_Op loc_intreg32[] = ++ { ++ { .atom = DW_OP_reg28 }, { .atom = DW_OP_piece, .number = 4 }, ++ { .atom = DW_OP_reg29 }, { .atom = DW_OP_piece, .number = 4 }, ++ }; ++ ++static const Dwarf_Op loc_intreg[] = ++ { ++ { .atom = DW_OP_reg28 }, { .atom = DW_OP_piece, .number = 8 }, ++ { .atom = DW_OP_reg29 }, { .atom = DW_OP_piece, .number = 8 }, ++ }; ++#define nloc_intreg 1 ++#define nloc_intregpair 4 ++ ++/* %fr4L, or pair %fr4L, %fr4R on pa-32 */ ++static const Dwarf_Op loc_fpreg32[] = ++ { ++ { .atom = DW_OP_regx, .number = 72 }, { .atom = DW_OP_piece, .number = 4 }, ++ { .atom = DW_OP_regx, .number = 73 }, { .atom = DW_OP_piece, .number = 4 }, ++ }; ++#define nloc_fpreg32 2 ++#define nloc_fpregpair32 4 ++ ++/* $fr4 */ ++static const Dwarf_Op loc_fpreg[] = ++ { ++ { .atom = DW_OP_regx, .number = 72 }, ++ }; ++#define nloc_fpreg 1 ++ ++#if 0 ++/* The return value is a structure and is actually stored in stack space ++ passed in a hidden argument by the caller. Address of the location is stored ++ in %r28 before function call, but it may be changed by function. */ ++static const Dwarf_Op loc_aggregate[] = ++ { ++ { .atom = DW_OP_breg28 }, ++ }; ++#define nloc_aggregate 1 ++#endif ++ ++static int ++parisc_return_value_location_ (Dwarf_Die *functypedie, const Dwarf_Op **locp, int pa64) ++{ ++ Dwarf_Word regsize = pa64 ? 8 : 4; ++ ++ /* Start with the function's type, and get the DW_AT_type attribute, ++ which is the type of the return value. */ ++ ++ Dwarf_Attribute attr_mem; ++ Dwarf_Attribute *attr = dwarf_attr_integrate (functypedie, DW_AT_type, &attr_mem); ++ if (attr == NULL) ++ /* The function has no return value, like a `void' function in C. */ ++ return 0; ++ ++ Dwarf_Die die_mem; ++ Dwarf_Die *typedie = dwarf_formref_die (attr, &die_mem); ++ int tag = dwarf_tag (typedie); ++ ++ /* Follow typedefs and qualifiers to get to the actual type. */ ++ while (tag == DW_TAG_typedef ++ || tag == DW_TAG_const_type || tag == DW_TAG_volatile_type ++ || tag == DW_TAG_restrict_type) ++ { ++ attr = dwarf_attr_integrate (typedie, DW_AT_type, &attr_mem); ++ typedie = dwarf_formref_die (attr, &die_mem); ++ tag = dwarf_tag (typedie); ++ } ++ ++ switch (tag) ++ { ++ case -1: ++ return -1; ++ ++ case DW_TAG_subrange_type: ++ if (! dwarf_hasattr_integrate (typedie, DW_AT_byte_size)) ++ { ++ attr = dwarf_attr_integrate (typedie, DW_AT_type, &attr_mem); ++ typedie = dwarf_formref_die (attr, &die_mem); ++ tag = dwarf_tag (typedie); ++ } ++ /* Fall through. */ ++ ++ case DW_TAG_base_type: ++ case DW_TAG_enumeration_type: ++ case DW_TAG_pointer_type: ++ case DW_TAG_ptr_to_member_type: ++ { ++ Dwarf_Word size; ++ if (dwarf_formudata (dwarf_attr_integrate (typedie, DW_AT_byte_size, ++ &attr_mem), &size) != 0) ++ { ++ if (tag == DW_TAG_pointer_type || tag == DW_TAG_ptr_to_member_type) ++ size = 4; ++ else ++ return -1; ++ } ++ if (tag == DW_TAG_base_type) ++ { ++ Dwarf_Word encoding; ++ if (dwarf_formudata (dwarf_attr_integrate (typedie, DW_AT_encoding, ++ &attr_mem), &encoding) != 0) ++ return -1; ++ ++ if (encoding == DW_ATE_float) ++ { ++ if (pa64) { ++ *locp = loc_fpreg; ++ if (size <= 8) ++ return nloc_fpreg; ++ } ++ else { ++ *locp = loc_fpreg32; ++ if (size <= 4) ++ return nloc_fpreg32; ++ else if (size <= 8) ++ return nloc_fpregpair32; ++ } ++ goto aggregate; ++ } ++ } ++ if (pa64) ++ *locp = loc_intreg; ++ else ++ *locp = loc_intreg32; ++ if (size <= regsize) ++ return nloc_intreg; ++ if (size <= 2 * regsize) ++ return nloc_intregpair; ++ ++ /* Else fall through. */ ++ } ++ ++ case DW_TAG_structure_type: ++ case DW_TAG_class_type: ++ case DW_TAG_union_type: ++ case DW_TAG_array_type: ++ aggregate: { ++ Dwarf_Word size; ++ if (dwarf_aggregate_size (typedie, &size) != 0) ++ return -1; ++ if (pa64) ++ *locp = loc_intreg; ++ else ++ *locp = loc_intreg32; ++ if (size <= regsize) ++ return nloc_intreg; ++ if (size <= 2 * regsize) ++ return nloc_intregpair; ++#if 0 ++ /* there should be some way to know this location... But I do not see it. */ ++ *locp = loc_aggregate; ++ return nloc_aggregate; ++#endif ++ /* fall through. */ ++ } ++ } ++ ++ /* XXX We don't have a good way to return specific errors from ebl calls. ++ This value means we do not understand the type, but it is well-formed ++ DWARF and might be valid. */ ++ return -2; ++} ++ ++int ++parisc_return_value_location_32 (Dwarf_Die *functypedie, const Dwarf_Op **locp) ++{ ++ return parisc_return_value_location_ (functypedie, locp, 0); ++} ++ ++int ++parisc_return_value_location_64 (Dwarf_Die *functypedie, const Dwarf_Op **locp) ++{ ++ return parisc_return_value_location_ (functypedie, locp, 1); ++} ++ +diff --git a/backends/parisc_symbol.c b/backends/parisc_symbol.c +new file mode 100644 +index 0000000..d111a76 +--- /dev/null ++++ b/backends/parisc_symbol.c +@@ -0,0 +1,112 @@ ++/* PA-RISC specific symbolic name handling. ++ Copyright (C) 2002, 2005 Red Hat, Inc. ++ This file is part of Red Hat elfutils. ++ Written by Ulrich Drepper , 2002. ++ ++ Red Hat elfutils is free software; you can redistribute it and/or modify ++ it under the terms of the GNU General Public License as published by the ++ Free Software Foundation; version 2 of the License. ++ ++ Red Hat 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 a copy of the GNU General Public License along ++ with Red Hat elfutils; if not, write to the Free Software Foundation, ++ Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301 USA. ++ ++ Red Hat elfutils is an included package of the Open Invention Network. ++ An included package of the Open Invention Network is a package for which ++ Open Invention Network licensees cross-license their patents. No patent ++ license is granted, either expressly or impliedly, by designation as an ++ included package. Should you wish to participate in the Open Invention ++ Network licensing program, please visit www.openinventionnetwork.com ++ . */ ++ ++#ifdef HAVE_CONFIG_H ++# include ++#endif ++ ++#include ++#include ++ ++#define BACKEND parisc_ ++#include "libebl_CPU.h" ++ ++const char * ++parisc_segment_type_name (int segment, char *buf __attribute__ ((unused)), ++ size_t len __attribute__ ((unused))) ++{ ++ switch (segment) ++ { ++ case PT_PARISC_ARCHEXT: ++ return "PARISC_ARCHEXT"; ++ case PT_PARISC_UNWIND: ++ return "PARISC_UNWIND"; ++ default: ++ break; ++ } ++ return NULL; ++} ++ ++/* Return symbolic representation of symbol type. */ ++const char * ++parisc_symbol_type_name(int symbol, char *buf __attribute__ ((unused)), ++ size_t len __attribute__ ((unused))) ++{ ++ if (symbol == STT_PARISC_MILLICODE) ++ return "PARISC_MILLI"; ++ return NULL; ++} ++ ++/* Return symbolic representation of section type. */ ++const char * ++parisc_section_type_name (int type, ++ char *buf __attribute__ ((unused)), ++ size_t len __attribute__ ((unused))) ++{ ++ switch (type) ++ { ++ case SHT_PARISC_EXT: ++ return "PARISC_EXT"; ++ case SHT_PARISC_UNWIND: ++ return "PARISC_UNWIND"; ++ case SHT_PARISC_DOC: ++ return "PARISC_DOC"; ++ } ++ ++ return NULL; ++} ++ ++/* Check whether machine flags are valid. */ ++bool ++parisc_machine_flag_check (GElf_Word flags) ++{ ++ if (flags &~ (EF_PARISC_TRAPNIL | EF_PARISC_EXT | EF_PARISC_LSB | ++ EF_PARISC_WIDE | EF_PARISC_NO_KABP | ++ EF_PARISC_LAZYSWAP | EF_PARISC_ARCH)) ++ return 0; ++ ++ GElf_Word arch = flags & EF_PARISC_ARCH; ++ ++ return ((arch == EFA_PARISC_1_0) || (arch == EFA_PARISC_1_1) || ++ (arch == EFA_PARISC_2_0)); ++} ++ ++/* Check for the simple reloc types. */ ++Elf_Type ++parisc_reloc_simple_type (Ebl *ebl __attribute__ ((unused)), int type) ++{ ++ switch (type) ++ { ++ case R_PARISC_DIR64: ++ case R_PARISC_SECREL64: ++ return ELF_T_XWORD; ++ case R_PARISC_DIR32: ++ case R_PARISC_SECREL32: ++ return ELF_T_WORD; ++ default: ++ return ELF_T_NUM; ++ } ++} +diff --git a/libelf/elf.h b/libelf/elf.h +index f774898..6c9f61e 100644 +--- a/libelf/elf.h ++++ b/libelf/elf.h +@@ -2153,16 +2153,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. */ ++#define R_PARISC_DPREL14WR 19 ++#define R_PARISC_DPREL14DR 20 + #define R_PARISC_DPREL14R 22 /* Right 14 bits of rel. address. */ + #define R_PARISC_GPREL21L 26 /* GP-relative, left 21 bits. */ + #define R_PARISC_GPREL14R 30 /* GP-relative, right 14 bits. */ + #define R_PARISC_LTOFF21L 34 /* LT-relative, left 21 bits. */ + #define R_PARISC_LTOFF14R 38 /* LT-relative, right 14 bits. */ ++#define R_PARISC_DLTIND14F 39 ++#define R_PARISC_SETBASE 40 + #define R_PARISC_SECREL32 41 /* 32 bits section rel. address. */ ++#define R_PARISC_BASEREL21L 42 ++#define R_PARISC_BASEREL17R 43 ++#define R_PARISC_BASEREL14R 46 + #define R_PARISC_SEGBASE 48 /* No relocation, set segment base. */ + #define R_PARISC_SEGREL32 49 /* 32 bits segment rel. address. */ + #define R_PARISC_PLTOFF21L 50 /* PLT rel. address, left 21 bits. */ + #define R_PARISC_PLTOFF14R 54 /* PLT rel. address, right 14 bits. */ ++#define R_PARISC_PLTOFF14F 55 + #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. */ +@@ -2171,6 +2179,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. */ ++#define R_PARISC_PCREL22C 73 + #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. */ +@@ -2196,6 +2205,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. */ ++#define R_PARISC_BASEREL14WR 107 ++#define R_PARISC_BASEREL14DR 108 + #define R_PARISC_SEGREL64 112 /* 64 bits segment rel. address. */ + #define R_PARISC_PLTOFF14WR 115 /* PLT-rel. address, right 14 bits. */ + #define R_PARISC_PLTOFF14DR 116 /* PLT-rel. address, right 14 bits. */ +-- +2.7.4 + diff --git a/meta/recipes-devtools/elfutils/files/debian/0001-mips_backend.patch b/meta/recipes-devtools/elfutils/files/debian/0001-mips_backend.patch new file mode 100644 index 0000000000..3004e19828 --- /dev/null +++ b/meta/recipes-devtools/elfutils/files/debian/0001-mips_backend.patch @@ -0,0 +1,718 @@ +From 59ffb86bda845a68d3686afa7bc784131df678f7 Mon Sep 17 00:00:00 2001 +From: Hongxu Jia +Date: Fri, 29 Jun 2018 15:45:58 +0800 +Subject: [PATCH] mips_backend + +Upstream-Status: Backport from debian +mips_backend.diff and rebase to 0.172 + +http://ftp.de.debian.org/debian/pool/main/e/elfutils/elfutils_0.170-0.5.debian.tar.xz + +Signed-off-by: Hongxu Jia +--- + backends/Makefile.am | 8 +- + backends/mips_init.c | 59 +++++++++ + backends/mips_regs.c | 104 ++++++++++++++++ + backends/mips_reloc.def | 79 ++++++++++++ + backends/mips_retval.c | 321 ++++++++++++++++++++++++++++++++++++++++++++++++ + backends/mips_symbol.c | 52 ++++++++ + libebl/eblopenbackend.c | 2 + + 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 1e4b8e9..e7bccf8 100644 +--- a/backends/Makefile.am ++++ b/backends/Makefile.am +@@ -33,13 +33,13 @@ AM_CPPFLAGS += -I$(top_srcdir)/libebl -I$(top_srcdir)/libasm \ + + + 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) + +@@ -139,6 +139,10 @@ 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) + ++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: *; };' \ +diff --git a/backends/mips_init.c b/backends/mips_init.c +new file mode 100644 +index 0000000..975c04e +--- /dev/null ++++ b/backends/mips_init.c +@@ -0,0 +1,59 @@ ++/* Initialization of mips specific backend library. ++ Copyright (C) 2006 Red Hat, Inc. ++ This file is part of Red Hat elfutils. ++ ++ Red Hat elfutils is free software; you can redistribute it and/or modify ++ it under the terms of the GNU General Public License as published by the ++ Free Software Foundation; version 2 of the License. ++ ++ Red Hat 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 a copy of the GNU General Public License along ++ with Red Hat elfutils; if not, write to the Free Software Foundation, ++ Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301 USA. ++ ++ Red Hat elfutils is an included package of the Open Invention Network. ++ An included package of the Open Invention Network is a package for which ++ Open Invention Network licensees cross-license their patents. No patent ++ license is granted, either expressly or impliedly, by designation as an ++ included package. Should you wish to participate in the Open Invention ++ Network licensing program, please visit www.openinventionnetwork.com ++ . */ ++ ++#ifdef HAVE_CONFIG_H ++# include ++#endif ++ ++#define BACKEND mips_ ++#define RELOC_PREFIX R_MIPS_ ++#include "libebl_CPU.h" ++ ++/* This defines the common reloc hooks based on mips_reloc.def. */ ++#include "common-reloc.c" ++ ++const char * ++mips_init (Elf *elf __attribute__ ((unused)), ++ GElf_Half machine __attribute__ ((unused)), ++ Ebl *eh, ++ size_t ehlen) ++{ ++ /* Check whether the Elf_BH object has a sufficent size. */ ++ if (ehlen < sizeof (Ebl)) ++ return NULL; ++ ++ /* We handle it. */ ++ if (machine == EM_MIPS) ++ eh->name = "MIPS R3000 big-endian"; ++ else if (machine == EM_MIPS_RS3_LE) ++ eh->name = "MIPS R3000 little-endian"; ++ ++ mips_init_reloc (eh); ++ HOOK (eh, reloc_simple_type); ++ HOOK (eh, return_value_location); ++ HOOK (eh, register_info); ++ ++ return MODVERSION; ++} +diff --git a/backends/mips_regs.c b/backends/mips_regs.c +new file mode 100644 +index 0000000..44f86cb +--- /dev/null ++++ b/backends/mips_regs.c +@@ -0,0 +1,104 @@ ++/* Register names and numbers for MIPS DWARF. ++ Copyright (C) 2006 Red Hat, Inc. ++ This file is part of Red Hat elfutils. ++ ++ Red Hat elfutils is free software; you can redistribute it and/or modify ++ it under the terms of the GNU General Public License as published by the ++ Free Software Foundation; version 2 of the License. ++ ++ Red Hat 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 a copy of the GNU General Public License along ++ with Red Hat elfutils; if not, write to the Free Software Foundation, ++ Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301 USA. ++ ++ Red Hat elfutils is an included package of the Open Invention Network. ++ An included package of the Open Invention Network is a package for which ++ Open Invention Network licensees cross-license their patents. No patent ++ license is granted, either expressly or impliedly, by designation as an ++ included package. Should you wish to participate in the Open Invention ++ Network licensing program, please visit www.openinventionnetwork.com ++ . */ ++ ++#ifdef HAVE_CONFIG_H ++# include ++#endif ++ ++#include ++#include ++ ++#define BACKEND mips_ ++#include "libebl_CPU.h" ++ ++ssize_t ++mips_register_info (Ebl *ebl __attribute__((unused)), ++ int regno, char *name, size_t namelen, ++ const char **prefix, const char **setname, ++ int *bits, int *type) ++{ ++ if (name == NULL) ++ return 66; ++ ++ if (regno < 0 || regno > 65 || namelen < 4) ++ return -1; ++ ++ *prefix = "$"; ++ ++ if (regno < 32) ++ { ++ *setname = "integer"; ++ *type = DW_ATE_signed; ++ *bits = 32; ++ if (regno < 32 + 10) ++ { ++ name[0] = regno + '0'; ++ namelen = 1; ++ } ++ else ++ { ++ name[0] = (regno / 10) + '0'; ++ name[1] = (regno % 10) + '0'; ++ namelen = 2; ++ } ++ } ++ else if (regno < 64) ++ { ++ *setname = "FPU"; ++ *type = DW_ATE_float; ++ *bits = 32; ++ name[0] = 'f'; ++ if (regno < 32 + 10) ++ { ++ name[1] = (regno - 32) + '0'; ++ namelen = 2; ++ } ++ else ++ { ++ name[1] = (regno - 32) / 10 + '0'; ++ name[2] = (regno - 32) % 10 + '0'; ++ namelen = 3; ++ } ++ } ++ else if (regno == 64) ++ { ++ *type = DW_ATE_signed; ++ *bits = 32; ++ name[0] = 'h'; ++ name[1] = 'i'; ++ namelen = 2; ++ } ++ else ++ { ++ *type = DW_ATE_signed; ++ *bits = 32; ++ name[0] = 'l'; ++ name[1] = 'o'; ++ namelen = 2; ++ } ++ ++ name[namelen++] = '\0'; ++ return namelen; ++} +diff --git a/backends/mips_reloc.def b/backends/mips_reloc.def +new file mode 100644 +index 0000000..4579970 +--- /dev/null ++++ b/backends/mips_reloc.def +@@ -0,0 +1,79 @@ ++/* List the relocation types for mips. -*- C -*- ++ Copyright (C) 2006 Red Hat, Inc. ++ This file is part of Red Hat elfutils. ++ ++ Red Hat elfutils is free software; you can redistribute it and/or modify ++ it under the terms of the GNU General Public License as published by the ++ Free Software Foundation; version 2 of the License. ++ ++ Red Hat 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 a copy of the GNU General Public License along ++ with Red Hat elfutils; if not, write to the Free Software Foundation, ++ Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301 USA. ++ ++ Red Hat elfutils is an included package of the Open Invention Network. ++ An included package of the Open Invention Network is a package for which ++ Open Invention Network licensees cross-license their patents. No patent ++ license is granted, either expressly or impliedly, by designation as an ++ included package. Should you wish to participate in the Open Invention ++ Network licensing program, please visit www.openinventionnetwork.com ++ . */ ++ ++/* NAME, REL|EXEC|DYN */ ++ ++RELOC_TYPE (NONE, 0) ++RELOC_TYPE (16, 0) ++RELOC_TYPE (32, 0) ++RELOC_TYPE (REL32, 0) ++RELOC_TYPE (26, 0) ++RELOC_TYPE (HI16, 0) ++RELOC_TYPE (LO16, 0) ++RELOC_TYPE (GPREL16, 0) ++RELOC_TYPE (LITERAL, 0) ++RELOC_TYPE (GOT16, 0) ++RELOC_TYPE (PC16, 0) ++RELOC_TYPE (CALL16, 0) ++RELOC_TYPE (GPREL32, 0) ++ ++RELOC_TYPE (SHIFT5, 0) ++RELOC_TYPE (SHIFT6, 0) ++RELOC_TYPE (64, 0) ++RELOC_TYPE (GOT_DISP, 0) ++RELOC_TYPE (GOT_PAGE, 0) ++RELOC_TYPE (GOT_OFST, 0) ++RELOC_TYPE (GOT_HI16, 0) ++RELOC_TYPE (GOT_LO16, 0) ++RELOC_TYPE (SUB, 0) ++RELOC_TYPE (INSERT_A, 0) ++RELOC_TYPE (INSERT_B, 0) ++RELOC_TYPE (DELETE, 0) ++RELOC_TYPE (HIGHER, 0) ++RELOC_TYPE (HIGHEST, 0) ++RELOC_TYPE (CALL_HI16, 0) ++RELOC_TYPE (CALL_LO16, 0) ++RELOC_TYPE (SCN_DISP, 0) ++RELOC_TYPE (REL16, 0) ++RELOC_TYPE (ADD_IMMEDIATE, 0) ++RELOC_TYPE (PJUMP, 0) ++RELOC_TYPE (RELGOT, 0) ++RELOC_TYPE (JALR, 0) ++RELOC_TYPE (TLS_DTPMOD32, 0) ++RELOC_TYPE (TLS_DTPREL32, 0) ++RELOC_TYPE (TLS_DTPMOD64, 0) ++RELOC_TYPE (TLS_DTPREL64, 0) ++RELOC_TYPE (TLS_GD, 0) ++RELOC_TYPE (TLS_LDM, 0) ++RELOC_TYPE (TLS_DTPREL_HI16, 0) ++RELOC_TYPE (TLS_DTPREL_LO16, 0) ++RELOC_TYPE (TLS_GOTTPREL, 0) ++RELOC_TYPE (TLS_TPREL32, 0) ++RELOC_TYPE (TLS_TPREL64, 0) ++RELOC_TYPE (TLS_TPREL_HI16, 0) ++RELOC_TYPE (TLS_TPREL_LO16, 0) ++ ++#define NO_COPY_RELOC 1 ++#define NO_RELATIVE_RELOC 1 +diff --git a/backends/mips_retval.c b/backends/mips_retval.c +new file mode 100644 +index 0000000..656cd1f +--- /dev/null ++++ b/backends/mips_retval.c +@@ -0,0 +1,321 @@ ++/* Function return value location for Linux/mips ABI. ++ Copyright (C) 2005 Red Hat, Inc. ++ This file is part of Red Hat elfutils. ++ ++ Red Hat elfutils is free software; you can redistribute it and/or modify ++ it under the terms of the GNU General Public License as published by the ++ Free Software Foundation; version 2 of the License. ++ ++ Red Hat 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 a copy of the GNU General Public License along ++ with Red Hat elfutils; if not, write to the Free Software Foundation, ++ Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301 USA. ++ ++ Red Hat elfutils is an included package of the Open Invention Network. ++ An included package of the Open Invention Network is a package for which ++ Open Invention Network licensees cross-license their patents. No patent ++ license is granted, either expressly or impliedly, by designation as an ++ included package. Should you wish to participate in the Open Invention ++ Network licensing program, please visit www.openinventionnetwork.com ++ . */ ++ ++#ifdef HAVE_CONFIG_H ++# include ++#endif ++ ++#include ++#include ++#include ++#include ++ ++#include "../libebl/libeblP.h" ++#include "../libdw/libdwP.h" ++ ++#define BACKEND mips_ ++#include "libebl_CPU.h" ++ ++/* The ABI of the file. Also see EF_MIPS_ABI2 above. */ ++#define EF_MIPS_ABI 0x0000F000 ++ ++/* The original o32 abi. */ ++#define E_MIPS_ABI_O32 0x00001000 ++ ++/* O32 extended to work on 64 bit architectures */ ++#define E_MIPS_ABI_O64 0x00002000 ++ ++/* EABI in 32 bit mode */ ++#define E_MIPS_ABI_EABI32 0x00003000 ++ ++/* EABI in 64 bit mode */ ++#define E_MIPS_ABI_EABI64 0x00004000 ++ ++/* All the possible MIPS ABIs. */ ++enum mips_abi ++ { ++ MIPS_ABI_UNKNOWN = 0, ++ MIPS_ABI_N32, ++ MIPS_ABI_O32, ++ MIPS_ABI_N64, ++ MIPS_ABI_O64, ++ MIPS_ABI_EABI32, ++ MIPS_ABI_EABI64, ++ MIPS_ABI_LAST ++ }; ++ ++/* Find the mips ABI of the current file */ ++enum mips_abi find_mips_abi(Elf *elf) ++{ ++ GElf_Ehdr ehdr_mem; ++ GElf_Ehdr *ehdr = gelf_getehdr (elf, &ehdr_mem); ++ ++ if (ehdr == NULL) ++ return MIPS_ABI_LAST; ++ ++ GElf_Word elf_flags = ehdr->e_flags; ++ ++ /* Check elf_flags to see if it specifies the ABI being used. */ ++ switch ((elf_flags & EF_MIPS_ABI)) ++ { ++ case E_MIPS_ABI_O32: ++ return MIPS_ABI_O32; ++ case E_MIPS_ABI_O64: ++ return MIPS_ABI_O64; ++ case E_MIPS_ABI_EABI32: ++ return MIPS_ABI_EABI32; ++ case E_MIPS_ABI_EABI64: ++ return MIPS_ABI_EABI64; ++ default: ++ if ((elf_flags & EF_MIPS_ABI2)) ++ return MIPS_ABI_N32; ++ } ++ ++ /* GCC creates a pseudo-section whose name describes the ABI. */ ++ size_t shstrndx; ++ if (elf_getshdrstrndx (elf, &shstrndx) < 0) ++ return MIPS_ABI_LAST; ++ ++ const char *name; ++ Elf_Scn *scn = NULL; ++ while ((scn = elf_nextscn (elf, scn)) != NULL) ++ { ++ GElf_Shdr shdr_mem; ++ GElf_Shdr *shdr = gelf_getshdr (scn, &shdr_mem); ++ if (shdr == NULL) ++ return MIPS_ABI_LAST; ++ ++ name = elf_strptr (elf, shstrndx, shdr->sh_name) ?: ""; ++ if (strncmp (name, ".mdebug.", 8) != 0) ++ continue; ++ ++ if (strcmp (name, ".mdebug.abi32") == 0) ++ return MIPS_ABI_O32; ++ else if (strcmp (name, ".mdebug.abiN32") == 0) ++ return MIPS_ABI_N32; ++ else if (strcmp (name, ".mdebug.abi64") == 0) ++ return MIPS_ABI_N64; ++ else if (strcmp (name, ".mdebug.abiO64") == 0) ++ return MIPS_ABI_O64; ++ else if (strcmp (name, ".mdebug.eabi32") == 0) ++ return MIPS_ABI_EABI32; ++ else if (strcmp (name, ".mdebug.eabi64") == 0) ++ return MIPS_ABI_EABI64; ++ else ++ return MIPS_ABI_UNKNOWN; ++ } ++ ++ return MIPS_ABI_UNKNOWN; ++} ++ ++unsigned int ++mips_abi_regsize (enum mips_abi abi) ++{ ++ switch (abi) ++ { ++ case MIPS_ABI_EABI32: ++ case MIPS_ABI_O32: ++ return 4; ++ case MIPS_ABI_N32: ++ case MIPS_ABI_N64: ++ case MIPS_ABI_O64: ++ case MIPS_ABI_EABI64: ++ return 8; ++ case MIPS_ABI_UNKNOWN: ++ case MIPS_ABI_LAST: ++ default: ++ return 0; ++ } ++} ++ ++ ++/* $v0 or pair $v0, $v1 */ ++static const Dwarf_Op loc_intreg_o32[] = ++ { ++ { .atom = DW_OP_reg2 }, { .atom = DW_OP_piece, .number = 4 }, ++ { .atom = DW_OP_reg3 }, { .atom = DW_OP_piece, .number = 4 }, ++ }; ++ ++static const Dwarf_Op loc_intreg[] = ++ { ++ { .atom = DW_OP_reg2 }, { .atom = DW_OP_piece, .number = 8 }, ++ { .atom = DW_OP_reg3 }, { .atom = DW_OP_piece, .number = 8 }, ++ }; ++#define nloc_intreg 1 ++#define nloc_intregpair 4 ++ ++/* $f0 (float), or pair $f0, $f1 (double). ++ * f2/f3 are used for COMPLEX (= 2 doubles) returns in Fortran */ ++static const Dwarf_Op loc_fpreg_o32[] = ++ { ++ { .atom = DW_OP_regx, .number = 32 }, { .atom = DW_OP_piece, .number = 4 }, ++ { .atom = DW_OP_regx, .number = 33 }, { .atom = DW_OP_piece, .number = 4 }, ++ { .atom = DW_OP_regx, .number = 34 }, { .atom = DW_OP_piece, .number = 4 }, ++ { .atom = DW_OP_regx, .number = 35 }, { .atom = DW_OP_piece, .number = 4 }, ++ }; ++ ++/* $f0, or pair $f0, $f2. */ ++static const Dwarf_Op loc_fpreg[] = ++ { ++ { .atom = DW_OP_regx, .number = 32 }, { .atom = DW_OP_piece, .number = 8 }, ++ { .atom = DW_OP_regx, .number = 34 }, { .atom = DW_OP_piece, .number = 8 }, ++ }; ++#define nloc_fpreg 1 ++#define nloc_fpregpair 4 ++#define nloc_fpregquad 8 ++ ++/* The return value is a structure and is actually stored in stack space ++ passed in a hidden argument by the caller. But, the compiler ++ helpfully returns the address of that space in $v0. */ ++static const Dwarf_Op loc_aggregate[] = ++ { ++ { .atom = DW_OP_breg2, .number = 0 } ++ }; ++#define nloc_aggregate 1 ++ ++int ++mips_return_value_location (Dwarf_Die *functypedie, const Dwarf_Op **locp) ++{ ++ /* First find the ABI used by the elf object */ ++ enum mips_abi abi = find_mips_abi(functypedie->cu->dbg->elf); ++ ++ /* Something went seriously wrong while trying to figure out the ABI */ ++ if (abi == MIPS_ABI_LAST) ++ return -1; ++ ++ /* We couldn't identify the ABI, but the file seems valid */ ++ if (abi == MIPS_ABI_UNKNOWN) ++ return -2; ++ ++ /* Can't handle EABI variants */ ++ if ((abi == MIPS_ABI_EABI32) || (abi == MIPS_ABI_EABI64)) ++ return -2; ++ ++ unsigned int regsize = mips_abi_regsize (abi); ++ if (!regsize) ++ return -2; ++ ++ /* Start with the function's type, and get the DW_AT_type attribute, ++ which is the type of the return value. */ ++ ++ Dwarf_Attribute attr_mem; ++ Dwarf_Attribute *attr = dwarf_attr_integrate (functypedie, DW_AT_type, &attr_mem); ++ if (attr == NULL) ++ /* The function has no return value, like a `void' function in C. */ ++ return 0; ++ ++ Dwarf_Die die_mem; ++ Dwarf_Die *typedie = dwarf_formref_die (attr, &die_mem); ++ int tag = dwarf_tag (typedie); ++ ++ /* Follow typedefs and qualifiers to get to the actual type. */ ++ while (tag == DW_TAG_typedef ++ || tag == DW_TAG_const_type || tag == DW_TAG_volatile_type ++ || tag == DW_TAG_restrict_type) ++ { ++ attr = dwarf_attr_integrate (typedie, DW_AT_type, &attr_mem); ++ typedie = dwarf_formref_die (attr, &die_mem); ++ tag = dwarf_tag (typedie); ++ } ++ ++ switch (tag) ++ { ++ case -1: ++ return -1; ++ ++ case DW_TAG_subrange_type: ++ if (! dwarf_hasattr_integrate (typedie, DW_AT_byte_size)) ++ { ++ attr = dwarf_attr_integrate (typedie, DW_AT_type, &attr_mem); ++ typedie = dwarf_formref_die (attr, &die_mem); ++ tag = dwarf_tag (typedie); ++ } ++ /* Fall through. */ ++ ++ case DW_TAG_base_type: ++ case DW_TAG_enumeration_type: ++ case DW_TAG_pointer_type: ++ case DW_TAG_ptr_to_member_type: ++ { ++ Dwarf_Word size; ++ if (dwarf_formudata (dwarf_attr_integrate (typedie, DW_AT_byte_size, ++ &attr_mem), &size) != 0) ++ { ++ if (tag == DW_TAG_pointer_type || tag == DW_TAG_ptr_to_member_type) ++ size = regsize; ++ else ++ return -1; ++ } ++ if (tag == DW_TAG_base_type) ++ { ++ Dwarf_Word encoding; ++ if (dwarf_formudata (dwarf_attr_integrate (typedie, DW_AT_encoding, ++ &attr_mem), &encoding) != 0) ++ return -1; ++ ++#define ABI_LOC(loc, regsize) ((regsize) == 4 ? (loc ## _o32) : (loc)) ++ ++ if (encoding == DW_ATE_float) ++ { ++ *locp = ABI_LOC(loc_fpreg, regsize); ++ if (size <= regsize) ++ return nloc_fpreg; ++ ++ if (size <= 2*regsize) ++ return nloc_fpregpair; ++ ++ if (size <= 4*regsize && abi == MIPS_ABI_O32) ++ return nloc_fpregquad; ++ ++ goto aggregate; ++ } ++ } ++ *locp = ABI_LOC(loc_intreg, regsize); ++ if (size <= regsize) ++ return nloc_intreg; ++ if (size <= 2*regsize) ++ return nloc_intregpair; ++ ++ /* Else fall through. Shouldn't happen though (at least with gcc) */ ++ } ++ ++ case DW_TAG_structure_type: ++ case DW_TAG_class_type: ++ case DW_TAG_union_type: ++ case DW_TAG_array_type: ++ aggregate: ++ /* XXX TODO: Can't handle structure return with other ABI's yet :-/ */ ++ if ((abi != MIPS_ABI_O32) && (abi != MIPS_ABI_O64)) ++ return -2; ++ ++ *locp = loc_aggregate; ++ return nloc_aggregate; ++ } ++ ++ /* XXX We don't have a good way to return specific errors from ebl calls. ++ This value means we do not understand the type, but it is well-formed ++ DWARF and might be valid. */ ++ return -2; ++} +diff --git a/backends/mips_symbol.c b/backends/mips_symbol.c +new file mode 100644 +index 0000000..ba465fe +--- /dev/null ++++ b/backends/mips_symbol.c +@@ -0,0 +1,52 @@ ++/* MIPS specific symbolic name handling. ++ Copyright (C) 2002, 2003, 2005 Red Hat, Inc. ++ This file is part of Red Hat elfutils. ++ Written by Jakub Jelinek , 2002. ++ ++ Red Hat elfutils is free software; you can redistribute it and/or modify ++ it under the terms of the GNU General Public License as published by the ++ Free Software Foundation; version 2 of the License. ++ ++ Red Hat 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 a copy of the GNU General Public License along ++ with Red Hat elfutils; if not, write to the Free Software Foundation, ++ Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301 USA. ++ ++ Red Hat elfutils is an included package of the Open Invention Network. ++ An included package of the Open Invention Network is a package for which ++ Open Invention Network licensees cross-license their patents. No patent ++ license is granted, either expressly or impliedly, by designation as an ++ included package. Should you wish to participate in the Open Invention ++ Network licensing program, please visit www.openinventionnetwork.com ++ . */ ++ ++#ifdef HAVE_CONFIG_H ++# include ++#endif ++ ++#include ++#include ++ ++#define BACKEND mips_ ++#include "libebl_CPU.h" ++ ++/* Check for the simple reloc types. */ ++Elf_Type ++mips_reloc_simple_type (Ebl *ebl __attribute__ ((unused)), int type) ++{ ++ switch (type) ++ { ++ case R_MIPS_16: ++ return ELF_T_HALF; ++ case R_MIPS_32: ++ return ELF_T_WORD; ++ case R_MIPS_64: ++ return ELF_T_XWORD; ++ default: ++ return ELF_T_NUM; ++ } ++} +diff --git a/libebl/eblopenbackend.c b/libebl/eblopenbackend.c +index 8b063f4..5405b0c 100644 +--- a/libebl/eblopenbackend.c ++++ b/libebl/eblopenbackend.c +@@ -72,6 +72,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 }, +-- +2.7.4 + diff --git a/meta/recipes-devtools/elfutils/files/debian/0001-mips_readelf_w.patch b/meta/recipes-devtools/elfutils/files/debian/0001-mips_readelf_w.patch new file mode 100644 index 0000000000..294944ea54 --- /dev/null +++ b/meta/recipes-devtools/elfutils/files/debian/0001-mips_readelf_w.patch @@ -0,0 +1,39 @@ +From a188ea1ada6b990b72b91266ae02da058dcd9523 Mon Sep 17 00:00:00 2001 +From: Kurt Roeckx +Date: Fri, 29 Jun 2018 15:49:32 +0800 +Subject: [PATCH] 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. + +Signed-off-by: Kurt Roeckx + +Upstream-Status: Backport from debian +mips_readelf_w.patch and rebase to 0.172 + +http://ftp.de.debian.org/debian/pool/main/e/elfutils/elfutils_0.170-0.5.debian.tar.xz +Signed-off-by: Hongxu Jia +--- + src/readelf.c | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +diff --git a/src/readelf.c b/src/readelf.c +index f185897..0db197c 100644 +--- a/src/readelf.c ++++ b/src/readelf.c +@@ -10979,7 +10979,8 @@ print_debug (Dwfl_Module *dwflmod, Ebl *ebl, GElf_Ehdr *ehdr) + GElf_Shdr shdr_mem; + GElf_Shdr *shdr = gelf_getshdr (scn, &shdr_mem); + +- if (shdr != NULL && shdr->sh_type == SHT_PROGBITS) ++ if (shdr != NULL && ( ++ (shdr->sh_type == SHT_PROGBITS) || (shdr->sh_type == SHT_MIPS_DWARF))) + { + static const struct + { +-- +2.7.4 + diff --git a/meta/recipes-devtools/elfutils/files/debian/0001-testsuite-ignore-elflint.patch b/meta/recipes-devtools/elfutils/files/debian/0001-testsuite-ignore-elflint.patch new file mode 100644 index 0000000000..14f6909378 --- /dev/null +++ b/meta/recipes-devtools/elfutils/files/debian/0001-testsuite-ignore-elflint.patch @@ -0,0 +1,57 @@ +From fe7613a3b9f2443cc11917826348d4521f267c96 Mon Sep 17 00:00:00 2001 +From: Hongxu Jia +Date: Fri, 29 Jun 2018 15:48:33 +0800 +Subject: [PATCH] testsuite ignore elflint + +On many architectures this test fails because binaries/libs produced by +binutils don't pass elflint. However elfutils shouldn't FTBFS because of this. + +So we run the tests on all archs to see what breaks, but if it breaks we ignore +the result (exitcode 77 means: this test was skipped). + +Upstream-Status: Backport from debian +testsuite-ignore-elflint.diff and rebase to 0.172 + +Signed-off-by: Hongxu Jia +--- + 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/meta/recipes-devtools/elfutils/files/debian/0002-Add-support-for-mips64-abis-in-mips_retval.c.patch b/meta/recipes-devtools/elfutils/files/debian/0002-Add-support-for-mips64-abis-in-mips_retval.c.patch index b17498f5fa..72125c9ff0 100644 --- a/meta/recipes-devtools/elfutils/files/debian/0002-Add-support-for-mips64-abis-in-mips_retval.c.patch +++ b/meta/recipes-devtools/elfutils/files/debian/0002-Add-support-for-mips64-abis-in-mips_retval.c.patch @@ -4,9 +4,6 @@ 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 - -Upstream-Status: Backport [from debian] -Signed-off-by: Hongxu Jia --- backends/mips_retval.c | 104 ++++++++++++++++++++++++++++++++++++++++++++----- 1 file changed, 94 insertions(+), 10 deletions(-) diff --git a/meta/recipes-devtools/elfutils/files/debian/0003-Add-mips-n64-relocation-format-hack.patch b/meta/recipes-devtools/elfutils/files/debian/0003-Add-mips-n64-relocation-format-hack.patch index 2a5f8628d9..6c0ae37fea 100644 --- a/meta/recipes-devtools/elfutils/files/debian/0003-Add-mips-n64-relocation-format-hack.patch +++ b/meta/recipes-devtools/elfutils/files/debian/0003-Add-mips-n64-relocation-format-hack.patch @@ -12,9 +12,6 @@ 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 - -Upstream-Status: Backport [from debian] -Signed-off-by: Hongxu Jia --- libelf/gelf_getrel.c | 25 +++++++++++++++++++++++-- libelf/gelf_getrela.c | 25 +++++++++++++++++++++++-- @@ -203,7 +200,7 @@ Index: b/src/strip.c =================================================================== --- a/src/strip.c +++ b/src/strip.c -@@ -532,6 +532,23 @@ handle_elf (int fd, Elf *elf, const char +@@ -598,6 +598,23 @@ handle_elf (int fd, Elf *elf, const char goto fail; } diff --git a/meta/recipes-devtools/elfutils/files/debian/arm_backend.diff b/meta/recipes-devtools/elfutils/files/debian/arm_backend.diff deleted file mode 100644 index 50f4b059e3..0000000000 --- a/meta/recipes-devtools/elfutils/files/debian/arm_backend.diff +++ /dev/null @@ -1,603 +0,0 @@ -Upstream-Status: Backport [from debian] -Signed-off-by: Hongxu Jia - -Index: b/backends/arm_init.c -=================================================================== ---- a/backends/arm_init.c -+++ b/backends/arm_init.c -@@ -35,20 +35,31 @@ - #define RELOC_PREFIX R_ARM_ - #include "libebl_CPU.h" - -+#include "libebl_arm.h" -+ - /* This defines the common reloc hooks based on arm_reloc.def. */ - #include "common-reloc.c" - - - const char * --arm_init (Elf *elf __attribute__ ((unused)), -+arm_init (Elf *elf, - GElf_Half machine __attribute__ ((unused)), - Ebl *eh, - size_t ehlen) - { -+ int soft_float = 0; -+ - /* Check whether the Elf_BH object has a sufficent size. */ - if (ehlen < sizeof (Ebl)) - return NULL; - -+ if (elf) { -+ GElf_Ehdr ehdr_mem; -+ GElf_Ehdr *ehdr = gelf_getehdr (elf, &ehdr_mem); -+ if (ehdr && (ehdr->e_flags & EF_ARM_SOFT_FLOAT)) -+ soft_float = 1; -+ } -+ - /* We handle it. */ - eh->name = "ARM"; - arm_init_reloc (eh); -@@ -60,7 +71,10 @@ arm_init (Elf *elf __attribute__ ((unuse - HOOK (eh, core_note); - HOOK (eh, auxv_info); - HOOK (eh, check_object_attribute); -- HOOK (eh, return_value_location); -+ if (soft_float) -+ eh->return_value_location = arm_return_value_location_soft; -+ else -+ eh->return_value_location = arm_return_value_location_hard; - HOOK (eh, abi_cfi); - HOOK (eh, check_reloc_target_type); - HOOK (eh, symbol_type_name); -Index: b/backends/arm_regs.c -=================================================================== ---- a/backends/arm_regs.c -+++ b/backends/arm_regs.c -@@ -31,6 +31,7 @@ - #endif - - #include -+#include - #include - - #define BACKEND arm_ -@@ -76,6 +77,9 @@ arm_register_info (Ebl *ebl __attribute_ - break; - - case 16 + 0 ... 16 + 7: -+ /* AADWARF says that there are no registers in that range, -+ * but gcc maps FPA registers here -+ */ - regno += 96 - 16; - /* Fall through. */ - case 96 + 0 ... 96 + 7: -@@ -87,11 +91,139 @@ arm_register_info (Ebl *ebl __attribute_ - namelen = 2; - break; - -+ case 64 + 0 ... 64 + 9: -+ *setname = "VFP"; -+ *bits = 32; -+ *type = DW_ATE_float; -+ name[0] = 's'; -+ name[1] = regno - 64 + '0'; -+ namelen = 2; -+ break; -+ -+ case 64 + 10 ... 64 + 31: -+ *setname = "VFP"; -+ *bits = 32; -+ *type = DW_ATE_float; -+ name[0] = 's'; -+ name[1] = (regno - 64) / 10 + '0'; -+ name[2] = (regno - 64) % 10 + '0'; -+ namelen = 3; -+ break; -+ -+ case 104 + 0 ... 104 + 7: -+ /* XXX TODO: -+ * This can be either intel wireless MMX general purpose/control -+ * registers or xscale accumulator, which have different usage. -+ * We only have the intel wireless MMX here now. -+ * The name needs to be changed for the xscale accumulator too. */ -+ *setname = "MMX"; -+ *type = DW_ATE_unsigned; -+ *bits = 32; -+ memcpy(name, "wcgr", 4); -+ name[4] = regno - 104 + '0'; -+ namelen = 5; -+ break; -+ -+ case 112 + 0 ... 112 + 9: -+ *setname = "MMX"; -+ *type = DW_ATE_unsigned; -+ *bits = 64; -+ name[0] = 'w'; -+ name[1] = 'r'; -+ name[2] = regno - 112 + '0'; -+ namelen = 3; -+ break; -+ -+ case 112 + 10 ... 112 + 15: -+ *setname = "MMX"; -+ *type = DW_ATE_unsigned; -+ *bits = 64; -+ name[0] = 'w'; -+ name[1] = 'r'; -+ name[2] = '1'; -+ name[3] = regno - 112 - 10 + '0'; -+ namelen = 4; -+ break; -+ - case 128: -+ *setname = "state"; - *type = DW_ATE_unsigned; - return stpcpy (name, "spsr") + 1 - name; - -+ case 129: -+ *setname = "state"; -+ *type = DW_ATE_unsigned; -+ return stpcpy(name, "spsr_fiq") + 1 - name; -+ -+ case 130: -+ *setname = "state"; -+ *type = DW_ATE_unsigned; -+ return stpcpy(name, "spsr_irq") + 1 - name; -+ -+ case 131: -+ *setname = "state"; -+ *type = DW_ATE_unsigned; -+ return stpcpy(name, "spsr_abt") + 1 - name; -+ -+ case 132: -+ *setname = "state"; -+ *type = DW_ATE_unsigned; -+ return stpcpy(name, "spsr_und") + 1 - name; -+ -+ case 133: -+ *setname = "state"; -+ *type = DW_ATE_unsigned; -+ return stpcpy(name, "spsr_svc") + 1 - name; -+ -+ case 144 ... 150: -+ *setname = "integer"; -+ *type = DW_ATE_signed; -+ *bits = 32; -+ return sprintf(name, "r%d_usr", regno - 144 + 8) + 1; -+ -+ case 151 ... 157: -+ *setname = "integer"; -+ *type = DW_ATE_signed; -+ *bits = 32; -+ return sprintf(name, "r%d_fiq", regno - 151 + 8) + 1; -+ -+ case 158 ... 159: -+ *setname = "integer"; -+ *type = DW_ATE_signed; -+ *bits = 32; -+ return sprintf(name, "r%d_irq", regno - 158 + 13) + 1; -+ -+ case 160 ... 161: -+ *setname = "integer"; -+ *type = DW_ATE_signed; -+ *bits = 32; -+ return sprintf(name, "r%d_abt", regno - 160 + 13) + 1; -+ -+ case 162 ... 163: -+ *setname = "integer"; -+ *type = DW_ATE_signed; -+ *bits = 32; -+ return sprintf(name, "r%d_und", regno - 162 + 13) + 1; -+ -+ case 164 ... 165: -+ *setname = "integer"; -+ *type = DW_ATE_signed; -+ *bits = 32; -+ return sprintf(name, "r%d_svc", regno - 164 + 13) + 1; -+ -+ case 192 ... 199: -+ *setname = "MMX"; -+ *bits = 32; -+ *type = DW_ATE_unsigned; -+ name[0] = 'w'; -+ name[1] = 'c'; -+ name[2] = regno - 192 + '0'; -+ namelen = 3; -+ break; -+ - case 256 + 0 ... 256 + 9: -+ /* XXX TODO: Neon also uses those registers and can contain -+ * both float and integers */ - *setname = "VFP"; - *type = DW_ATE_float; - *bits = 64; -Index: b/backends/arm_retval.c -=================================================================== ---- 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)) - -+/* f1 */ /* XXX TODO: f0 can also have number 96 if program was compiled with -mabi=aapcs */ -+static const Dwarf_Op loc_fpreg[] = -+ { -+ { .atom = DW_OP_reg16 }, -+ }; -+#define nloc_fpreg 1 -+ - /* The return value is a structure and is actually stored in stack space - passed in a hidden argument by the caller. But, the compiler - helpfully returns the address of that space in r0. */ -@@ -58,8 +65,9 @@ static const Dwarf_Op loc_aggregate[] = - #define nloc_aggregate 1 - - --int --arm_return_value_location (Dwarf_Die *functypedie, const Dwarf_Op **locp) -+static int -+arm_return_value_location_ (Dwarf_Die *functypedie, const Dwarf_Op **locp, -+ int soft_float) - { - /* 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 - else - return -1; - } -+ if (tag == DW_TAG_base_type) -+ { -+ Dwarf_Word encoding; -+ if (dwarf_formudata (dwarf_attr_integrate (typedie, DW_AT_encoding, -+ &attr_mem), &encoding) != 0) -+ return -1; -+ -+ if ((encoding == DW_ATE_float) && !soft_float) -+ { -+ *locp = loc_fpreg; -+ if (size <= 8) -+ return nloc_fpreg; -+ goto aggregate; -+ } -+ } - if (size <= 16) - { - intreg: -@@ -106,6 +129,7 @@ arm_return_value_location (Dwarf_Die *fu - } - - aggregate: -+ /* XXX TODO sometimes aggregates are returned in r0 (-mabi=aapcs) */ - *locp = loc_aggregate; - return nloc_aggregate; - } -@@ -125,3 +149,18 @@ arm_return_value_location (Dwarf_Die *fu - DWARF and might be valid. */ - return -2; - } -+ -+/* return location for -mabi=apcs-gnu -msoft-float */ -+int -+arm_return_value_location_soft (Dwarf_Die *functypedie, const Dwarf_Op **locp) -+{ -+ return arm_return_value_location_ (functypedie, locp, 1); -+} -+ -+/* return location for -mabi=apcs-gnu -mhard-float (current default) */ -+int -+arm_return_value_location_hard (Dwarf_Die *functypedie, const Dwarf_Op **locp) -+{ -+ return arm_return_value_location_ (functypedie, locp, 0); -+} -+ -Index: b/libelf/elf.h -=================================================================== ---- a/libelf/elf.h -+++ b/libelf/elf.h -@@ -2593,6 +2593,9 @@ enum - #define EF_ARM_EABI_VER4 0x04000000 - #define EF_ARM_EABI_VER5 0x05000000 - -+/* EI_OSABI values */ -+#define ELFOSABI_ARM_AEABI 64 /* Contains symbol versioning. */ -+ - /* Additional symbol types for Thumb. */ - #define STT_ARM_TFUNC STT_LOPROC /* A Thumb function. */ - #define STT_ARM_16BIT STT_HIPROC /* A Thumb label. */ -@@ -2610,12 +2613,19 @@ enum - - /* Processor specific values for the Phdr p_type field. */ - #define PT_ARM_EXIDX (PT_LOPROC + 1) /* ARM unwind segment. */ -+#define PT_ARM_UNWIND PT_ARM_EXIDX - - /* Processor specific values for the Shdr sh_type field. */ - #define SHT_ARM_EXIDX (SHT_LOPROC + 1) /* ARM unwind section. */ - #define SHT_ARM_PREEMPTMAP (SHT_LOPROC + 2) /* Preemption details. */ - #define SHT_ARM_ATTRIBUTES (SHT_LOPROC + 3) /* ARM attributes section. */ - -+/* Processor specific values for the Dyn d_tag field. */ -+#define DT_ARM_RESERVED1 (DT_LOPROC + 0) -+#define DT_ARM_SYMTABSZ (DT_LOPROC + 1) -+#define DT_ARM_PREEMTMAB (DT_LOPROC + 2) -+#define DT_ARM_RESERVED2 (DT_LOPROC + 3) -+#define DT_ARM_NUM 4 - - /* AArch64 relocs. */ - -@@ -2908,6 +2918,7 @@ enum - TLS block (LDR, STR). */ - #define R_ARM_TLS_IE12GP 111 /* 12 bit GOT entry relative - to GOT origin (LDR). */ -+/* 112 - 127 private range */ - #define R_ARM_ME_TOO 128 /* Obsolete. */ - #define R_ARM_THM_TLS_DESCSEQ 129 - #define R_ARM_THM_TLS_DESCSEQ16 129 -Index: b/backends/libebl_arm.h -=================================================================== ---- /dev/null -+++ b/backends/libebl_arm.h -@@ -0,0 +1,9 @@ -+#ifndef _LIBEBL_ARM_H -+#define _LIBEBL_ARM_H 1 -+ -+#include -+ -+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: b/tests/run-allregs.sh -=================================================================== ---- 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 - 15: pc (pc), address 32 bits -- 128: spsr (spsr), unsigned 32 bits -+ 144: r8_usr (r8_usr), signed 32 bits -+ 145: r9_usr (r9_usr), signed 32 bits -+ 146: r10_usr (r10_usr), signed 32 bits -+ 147: r11_usr (r11_usr), signed 32 bits -+ 148: r12_usr (r12_usr), signed 32 bits -+ 149: r13_usr (r13_usr), signed 32 bits -+ 150: r14_usr (r14_usr), signed 32 bits -+ 151: r8_fiq (r8_fiq), signed 32 bits -+ 152: r9_fiq (r9_fiq), signed 32 bits -+ 153: r10_fiq (r10_fiq), signed 32 bits -+ 154: r11_fiq (r11_fiq), signed 32 bits -+ 155: r12_fiq (r12_fiq), signed 32 bits -+ 156: r13_fiq (r13_fiq), signed 32 bits -+ 157: r14_fiq (r14_fiq), signed 32 bits -+ 158: r13_irq (r13_irq), signed 32 bits -+ 159: r14_irq (r14_irq), signed 32 bits -+ 160: r13_abt (r13_abt), signed 32 bits -+ 161: r14_abt (r14_abt), signed 32 bits -+ 162: r13_und (r13_und), signed 32 bits -+ 163: r14_und (r14_und), signed 32 bits -+ 164: r13_svc (r13_svc), signed 32 bits -+ 165: r14_svc (r14_svc), signed 32 bits - FPA registers: - 16: f0 (f0), float 96 bits - 17: f1 (f1), float 96 bits -@@ -2690,7 +2711,72 @@ FPA registers: - 101: f5 (f5), float 96 bits - 102: f6 (f6), float 96 bits - 103: f7 (f7), float 96 bits -+MMX registers: -+ 104: wcgr0 (wcgr0), unsigned 32 bits -+ 105: wcgr1 (wcgr1), unsigned 32 bits -+ 106: wcgr2 (wcgr2), unsigned 32 bits -+ 107: wcgr3 (wcgr3), unsigned 32 bits -+ 108: wcgr4 (wcgr4), unsigned 32 bits -+ 109: wcgr5 (wcgr5), unsigned 32 bits -+ 110: wcgr6 (wcgr6), unsigned 32 bits -+ 111: wcgr7 (wcgr7), unsigned 32 bits -+ 112: wr0 (wr0), unsigned 64 bits -+ 113: wr1 (wr1), unsigned 64 bits -+ 114: wr2 (wr2), unsigned 64 bits -+ 115: wr3 (wr3), unsigned 64 bits -+ 116: wr4 (wr4), unsigned 64 bits -+ 117: wr5 (wr5), unsigned 64 bits -+ 118: wr6 (wr6), unsigned 64 bits -+ 119: wr7 (wr7), unsigned 64 bits -+ 120: wr8 (wr8), unsigned 64 bits -+ 121: wr9 (wr9), unsigned 64 bits -+ 122: wr10 (wr10), unsigned 64 bits -+ 123: wr11 (wr11), unsigned 64 bits -+ 124: wr12 (wr12), unsigned 64 bits -+ 125: wr13 (wr13), unsigned 64 bits -+ 126: wr14 (wr14), unsigned 64 bits -+ 127: wr15 (wr15), unsigned 64 bits -+ 192: wc0 (wc0), unsigned 32 bits -+ 193: wc1 (wc1), unsigned 32 bits -+ 194: wc2 (wc2), unsigned 32 bits -+ 195: wc3 (wc3), unsigned 32 bits -+ 196: wc4 (wc4), unsigned 32 bits -+ 197: wc5 (wc5), unsigned 32 bits -+ 198: wc6 (wc6), unsigned 32 bits -+ 199: wc7 (wc7), unsigned 32 bits - VFP registers: -+ 64: s0 (s0), float 32 bits -+ 65: s1 (s1), float 32 bits -+ 66: s2 (s2), float 32 bits -+ 67: s3 (s3), float 32 bits -+ 68: s4 (s4), float 32 bits -+ 69: s5 (s5), float 32 bits -+ 70: s6 (s6), float 32 bits -+ 71: s7 (s7), float 32 bits -+ 72: s8 (s8), float 32 bits -+ 73: s9 (s9), float 32 bits -+ 74: s10 (s10), float 32 bits -+ 75: s11 (s11), float 32 bits -+ 76: s12 (s12), float 32 bits -+ 77: s13 (s13), float 32 bits -+ 78: s14 (s14), float 32 bits -+ 79: s15 (s15), float 32 bits -+ 80: s16 (s16), float 32 bits -+ 81: s17 (s17), float 32 bits -+ 82: s18 (s18), float 32 bits -+ 83: s19 (s19), float 32 bits -+ 84: s20 (s20), float 32 bits -+ 85: s21 (s21), float 32 bits -+ 86: s22 (s22), float 32 bits -+ 87: s23 (s23), float 32 bits -+ 88: s24 (s24), float 32 bits -+ 89: s25 (s25), float 32 bits -+ 90: s26 (s26), float 32 bits -+ 91: s27 (s27), float 32 bits -+ 92: s28 (s28), float 32 bits -+ 93: s29 (s29), float 32 bits -+ 94: s30 (s30), float 32 bits -+ 95: s31 (s31), float 32 bits - 256: d0 (d0), float 64 bits - 257: d1 (d1), float 64 bits - 258: d2 (d2), float 64 bits -@@ -2723,6 +2809,13 @@ VFP registers: - 285: d29 (d29), float 64 bits - 286: d30 (d30), float 64 bits - 287: d31 (d31), float 64 bits -+state registers: -+ 128: spsr (spsr), unsigned 32 bits -+ 129: spsr_fiq (spsr_fiq), unsigned 32 bits -+ 130: spsr_irq (spsr_irq), unsigned 32 bits -+ 131: spsr_abt (spsr_abt), unsigned 32 bits -+ 132: spsr_und (spsr_und), unsigned 32 bits -+ 133: spsr_svc (spsr_svc), unsigned 32 bits - EOF - - # See run-readelf-mixed-corenote.sh for instructions to regenerate -Index: b/tests/run-readelf-mixed-corenote.sh -=================================================================== ---- 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 0x27 - 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 -- r0: 1 r1: -1091672508 r2: -1091672500 -- r3: 0 r4: 0 r5: 0 -- r6: 33728 r7: 0 r8: 0 -- r9: 0 r10: -1225703496 r11: -1091672844 -- r12: 0 sp: 0xbeee64f4 lr: 0xb6dc3f48 -- pc: 0x00008500 spsr: 0x60000010 -+ r0: 1 r1: -1091672508 r2: -1091672500 r3: 0 -+ r4: 0 r5: 0 r6: 33728 r7: 0 -+ r8: 0 r9: 0 r10: -1225703496 r11: -1091672844 -+ r12: 0 sp: 0xbeee64f4 lr: 0xb6dc3f48 pc: 0x00008500 -+ spsr: 0x60000010 - 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: b/tests/run-addrcfi.sh -=================================================================== ---- a/tests/run-addrcfi.sh -+++ b/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 diff --git a/meta/recipes-devtools/elfutils/files/debian/hppa_backend.diff b/meta/recipes-devtools/elfutils/files/debian/hppa_backend.diff deleted file mode 100644 index 56f852a414..0000000000 --- a/meta/recipes-devtools/elfutils/files/debian/hppa_backend.diff +++ /dev/null @@ -1,802 +0,0 @@ -Upstream-Status: Backport [from debian] -Signed-off-by: Hongxu Jia - -Index: elfutils-0.170/backends/parisc_init.c -=================================================================== ---- /dev/null -+++ elfutils-0.170/backends/parisc_init.c -@@ -0,0 +1,73 @@ -+/* Initialization of PA-RISC specific backend library. -+ Copyright (C) 2002, 2005, 2006 Red Hat, Inc. -+ This file is part of Red Hat elfutils. -+ Written by Ulrich Drepper , 2002. -+ -+ Red Hat elfutils is free software; you can redistribute it and/or modify -+ it under the terms of the GNU General Public License as published by the -+ Free Software Foundation; version 2 of the License. -+ -+ Red Hat 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 a copy of the GNU General Public License along -+ with Red Hat elfutils; if not, write to the Free Software Foundation, -+ Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301 USA. -+ -+ Red Hat elfutils is an included package of the Open Invention Network. -+ An included package of the Open Invention Network is a package for which -+ Open Invention Network licensees cross-license their patents. No patent -+ license is granted, either expressly or impliedly, by designation as an -+ included package. Should you wish to participate in the Open Invention -+ Network licensing program, please visit www.openinventionnetwork.com -+ . */ -+ -+#ifdef HAVE_CONFIG_H -+# include -+#endif -+ -+#define BACKEND parisc_ -+#define RELOC_PREFIX R_PARISC_ -+#include "libebl_CPU.h" -+#include "libebl_parisc.h" -+ -+/* This defines the common reloc hooks based on parisc_reloc.def. */ -+#include "common-reloc.c" -+ -+ -+const char * -+parisc_init (Elf *elf __attribute__ ((unused)), -+ GElf_Half machine __attribute__ ((unused)), -+ Ebl *eh, -+ size_t ehlen) -+{ -+ int pa64 = 0; -+ -+ /* Check whether the Elf_BH object has a sufficent size. */ -+ if (ehlen < sizeof (Ebl)) -+ return NULL; -+ -+ if (elf) { -+ GElf_Ehdr ehdr_mem; -+ GElf_Ehdr *ehdr = gelf_getehdr (elf, &ehdr_mem); -+ if (ehdr && (ehdr->e_flags & EF_PARISC_WIDE)) -+ pa64 = 1; -+ } -+ /* We handle it. */ -+ eh->name = "PA-RISC"; -+ parisc_init_reloc (eh); -+ HOOK (eh, reloc_simple_type); -+ HOOK (eh, machine_flag_check); -+ HOOK (eh, symbol_type_name); -+ HOOK (eh, segment_type_name); -+ HOOK (eh, section_type_name); -+ HOOK (eh, register_info); -+ if (pa64) -+ eh->return_value_location = parisc_return_value_location_64; -+ else -+ eh->return_value_location = parisc_return_value_location_32; -+ -+ return MODVERSION; -+} -Index: elfutils-0.170/backends/parisc_regs.c -=================================================================== ---- /dev/null -+++ elfutils-0.170/backends/parisc_regs.c -@@ -0,0 +1,159 @@ -+/* Register names and numbers for PA-RISC DWARF. -+ Copyright (C) 2005, 2006 Red Hat, Inc. -+ This file is part of Red Hat elfutils. -+ -+ Red Hat elfutils is free software; you can redistribute it and/or modify -+ it under the terms of the GNU General Public License as published by the -+ Free Software Foundation; version 2 of the License. -+ -+ Red Hat 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 a copy of the GNU General Public License along -+ with Red Hat elfutils; if not, write to the Free Software Foundation, -+ Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301 USA. -+ -+ Red Hat elfutils is an included package of the Open Invention Network. -+ An included package of the Open Invention Network is a package for which -+ Open Invention Network licensees cross-license their patents. No patent -+ license is granted, either expressly or impliedly, by designation as an -+ included package. Should you wish to participate in the Open Invention -+ Network licensing program, please visit www.openinventionnetwork.com -+ . */ -+ -+#ifdef HAVE_CONFIG_H -+# include -+#endif -+ -+#include -+#include -+ -+#define BACKEND parisc_ -+#include "libebl_CPU.h" -+ -+ssize_t -+parisc_register_info (Ebl *ebl, int regno, char *name, size_t namelen, -+ const char **prefix, const char **setname, -+ int *bits, int *type) -+{ -+ int pa64 = 0; -+ -+ if (ebl->elf) { -+ GElf_Ehdr ehdr_mem; -+ GElf_Ehdr *ehdr = gelf_getehdr (ebl->elf, &ehdr_mem); -+ if (ehdr->e_flags & EF_PARISC_WIDE) -+ pa64 = 1; -+ } -+ -+ int nregs = pa64 ? 127 : 128; -+ -+ if (name == NULL) -+ return nregs; -+ -+ if (regno < 0 || regno >= nregs || namelen < 6) -+ return -1; -+ -+ *prefix = "%"; -+ -+ if (regno < 32) -+ { -+ *setname = "integer"; -+ *type = DW_ATE_signed; -+ if (pa64) -+ { -+ *bits = 64; -+ } -+ else -+ { -+ *bits = 32; -+ } -+ } -+ else if (regno == 32) -+ { -+ *setname = "special"; -+ if (pa64) -+ { -+ *bits = 6; -+ } -+ else -+ { -+ *bits = 5; -+ } -+ *type = DW_ATE_unsigned; -+ } -+ else -+ { -+ *setname = "FPU"; -+ *type = DW_ATE_float; -+ if (pa64) -+ { -+ *bits = 64; -+ } -+ else -+ { -+ *bits = 32; -+ } -+ } -+ -+ if (regno < 33) { -+ switch (regno) -+ { -+ case 0 ... 9: -+ name[0] = 'r'; -+ name[1] = regno + '0'; -+ namelen = 2; -+ break; -+ case 10 ... 31: -+ name[0] = 'r'; -+ name[1] = regno / 10 + '0'; -+ name[2] = regno % 10 + '0'; -+ namelen = 3; -+ break; -+ case 32: -+ *prefix = NULL; -+ name[0] = 'S'; -+ name[1] = 'A'; -+ name[2] = 'R'; -+ namelen = 3; -+ break; -+ } -+ } -+ else { -+ if (pa64 && ((regno - 72) % 2)) { -+ *setname = NULL; -+ return 0; -+ } -+ -+ switch (regno) -+ { -+ case 72 + 0 ... 72 + 11: -+ name[0] = 'f'; -+ name[1] = 'r'; -+ name[2] = (regno + 8 - 72) / 2 + '0'; -+ namelen = 3; -+ if ((regno + 8 - 72) % 2) { -+ name[3] = 'R'; -+ namelen++; -+ } -+ break; -+ case 72 + 12 ... 72 + 55: -+ name[0] = 'f'; -+ name[1] = 'r'; -+ name[2] = (regno + 8 - 72) / 2 / 10 + '0'; -+ name[3] = (regno + 8 - 72) / 2 % 10 + '0'; -+ namelen = 4; -+ if ((regno + 8 - 72) % 2) { -+ name[4] = 'R'; -+ namelen++; -+ } -+ break; -+ default: -+ *setname = NULL; -+ return 0; -+ } -+ } -+ name[namelen++] = '\0'; -+ return namelen; -+} -Index: elfutils-0.170/backends/parisc_reloc.def -=================================================================== ---- /dev/null -+++ elfutils-0.170/backends/parisc_reloc.def -@@ -0,0 +1,128 @@ -+/* List the relocation types for PA-RISC. -*- C -*- -+ Copyright (C) 2005 Red Hat, Inc. -+ This file is part of Red Hat elfutils. -+ -+ Red Hat elfutils is free software; you can redistribute it and/or modify -+ it under the terms of the GNU General Public License as published by the -+ Free Software Foundation; version 2 of the License. -+ -+ Red Hat 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 a copy of the GNU General Public License along -+ with Red Hat elfutils; if not, write to the Free Software Foundation, -+ Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301 USA. -+ -+ Red Hat elfutils is an included package of the Open Invention Network. -+ An included package of the Open Invention Network is a package for which -+ Open Invention Network licensees cross-license their patents. No patent -+ license is granted, either expressly or impliedly, by designation as an -+ included package. Should you wish to participate in the Open Invention -+ Network licensing program, please visit www.openinventionnetwork.com -+ . */ -+ -+/* NAME, REL|EXEC|DYN */ -+ -+RELOC_TYPE (NONE, EXEC|DYN) -+RELOC_TYPE (DIR32, REL|EXEC|DYN) -+RELOC_TYPE (DIR21L, REL|EXEC|DYN) -+RELOC_TYPE (DIR17R, REL) -+RELOC_TYPE (DIR17F, REL) -+RELOC_TYPE (DIR14R, REL|DYN) -+RELOC_TYPE (PCREL32, REL) -+RELOC_TYPE (PCREL21L, REL) -+RELOC_TYPE (PCREL17R, REL) -+RELOC_TYPE (PCREL17F, REL) -+RELOC_TYPE (PCREL14R, REL|EXEC) -+RELOC_TYPE (DPREL21L, REL) -+RELOC_TYPE (DPREL14WR, REL) -+RELOC_TYPE (DPREL14DR, REL) -+RELOC_TYPE (DPREL14R, REL) -+RELOC_TYPE (GPREL21L, 0) -+RELOC_TYPE (GPREL14R, 0) -+RELOC_TYPE (LTOFF21L, REL) -+RELOC_TYPE (LTOFF14R, REL) -+RELOC_TYPE (DLTIND14F, 0) -+RELOC_TYPE (SETBASE, 0) -+RELOC_TYPE (SECREL32, REL) -+RELOC_TYPE (BASEREL21L, 0) -+RELOC_TYPE (BASEREL17R, 0) -+RELOC_TYPE (BASEREL14R, 0) -+RELOC_TYPE (SEGBASE, 0) -+RELOC_TYPE (SEGREL32, REL) -+RELOC_TYPE (PLTOFF21L, 0) -+RELOC_TYPE (PLTOFF14R, 0) -+RELOC_TYPE (PLTOFF14F, 0) -+RELOC_TYPE (LTOFF_FPTR32, 0) -+RELOC_TYPE (LTOFF_FPTR21L, 0) -+RELOC_TYPE (LTOFF_FPTR14R, 0) -+RELOC_TYPE (FPTR64, 0) -+RELOC_TYPE (PLABEL32, REL|DYN) -+RELOC_TYPE (PCREL64, 0) -+RELOC_TYPE (PCREL22C, 0) -+RELOC_TYPE (PCREL22F, 0) -+RELOC_TYPE (PCREL14WR, 0) -+RELOC_TYPE (PCREL14DR, 0) -+RELOC_TYPE (PCREL16F, 0) -+RELOC_TYPE (PCREL16WF, 0) -+RELOC_TYPE (PCREL16DF, 0) -+RELOC_TYPE (DIR64, REL|DYN) -+RELOC_TYPE (DIR14WR, REL) -+RELOC_TYPE (DIR14DR, REL) -+RELOC_TYPE (DIR16F, REL) -+RELOC_TYPE (DIR16WF, REL) -+RELOC_TYPE (DIR16DF, REL) -+RELOC_TYPE (GPREL64, 0) -+RELOC_TYPE (GPREL14WR, 0) -+RELOC_TYPE (GPREL14DR, 0) -+RELOC_TYPE (GPREL16F, 0) -+RELOC_TYPE (GPREL16WF, 0) -+RELOC_TYPE (GPREL16DF, 0) -+RELOC_TYPE (LTOFF64, 0) -+RELOC_TYPE (LTOFF14WR, 0) -+RELOC_TYPE (LTOFF14DR, 0) -+RELOC_TYPE (LTOFF16F, 0) -+RELOC_TYPE (LTOFF16WF, 0) -+RELOC_TYPE (LTOFF16DF, 0) -+RELOC_TYPE (SECREL64, 0) -+RELOC_TYPE (BASEREL14WR, 0) -+RELOC_TYPE (BASEREL14DR, 0) -+RELOC_TYPE (SEGREL64, 0) -+RELOC_TYPE (PLTOFF14WR, 0) -+RELOC_TYPE (PLTOFF14DR, 0) -+RELOC_TYPE (PLTOFF16F, 0) -+RELOC_TYPE (PLTOFF16WF, 0) -+RELOC_TYPE (PLTOFF16DF, 0) -+RELOC_TYPE (LTOFF_FPTR64, 0) -+RELOC_TYPE (LTOFF_FPTR14WR, 0) -+RELOC_TYPE (LTOFF_FPTR14DR, 0) -+RELOC_TYPE (LTOFF_FPTR16F, 0) -+RELOC_TYPE (LTOFF_FPTR16WF, 0) -+RELOC_TYPE (LTOFF_FPTR16DF, 0) -+RELOC_TYPE (COPY, EXEC) -+RELOC_TYPE (IPLT, EXEC|DYN) -+RELOC_TYPE (EPLT, 0) -+RELOC_TYPE (TPREL32, DYN) -+RELOC_TYPE (TPREL21L, 0) -+RELOC_TYPE (TPREL14R, 0) -+RELOC_TYPE (LTOFF_TP21L, 0) -+RELOC_TYPE (LTOFF_TP14R, 0) -+RELOC_TYPE (LTOFF_TP14F, 0) -+RELOC_TYPE (TPREL64, 0) -+RELOC_TYPE (TPREL14WR, 0) -+RELOC_TYPE (TPREL14DR, 0) -+RELOC_TYPE (TPREL16F, 0) -+RELOC_TYPE (TPREL16WF, 0) -+RELOC_TYPE (TPREL16DF, 0) -+RELOC_TYPE (LTOFF_TP64, 0) -+RELOC_TYPE (LTOFF_TP14WR, 0) -+RELOC_TYPE (LTOFF_TP14DR, 0) -+RELOC_TYPE (LTOFF_TP16F, 0) -+RELOC_TYPE (LTOFF_TP16WF, 0) -+RELOC_TYPE (LTOFF_TP16DF, 0) -+RELOC_TYPE (TLS_DTPMOD32, DYN) -+RELOC_TYPE (TLS_DTPMOD64, DYN) -+ -+#define NO_RELATIVE_RELOC 1 -Index: elfutils-0.170/backends/parisc_retval.c -=================================================================== ---- /dev/null -+++ elfutils-0.170/backends/parisc_retval.c -@@ -0,0 +1,213 @@ -+/* Function return value location for Linux/PA-RISC ABI. -+ Copyright (C) 2005 Red Hat, Inc. -+ This file is part of Red Hat elfutils. -+ -+ Red Hat elfutils is free software; you can redistribute it and/or modify -+ it under the terms of the GNU General Public License as published by the -+ Free Software Foundation; version 2 of the License. -+ -+ Red Hat 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 a copy of the GNU General Public License along -+ with Red Hat elfutils; if not, write to the Free Software Foundation, -+ Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301 USA. -+ -+ Red Hat elfutils is an included package of the Open Invention Network. -+ An included package of the Open Invention Network is a package for which -+ Open Invention Network licensees cross-license their patents. No patent -+ license is granted, either expressly or impliedly, by designation as an -+ included package. Should you wish to participate in the Open Invention -+ Network licensing program, please visit www.openinventionnetwork.com -+ . */ -+ -+#ifdef HAVE_CONFIG_H -+# include -+#endif -+ -+#include -+#include -+ -+#define BACKEND parisc_ -+#include "libebl_CPU.h" -+#include "libebl_parisc.h" -+ -+/* %r28, or pair %r28, %r29. */ -+static const Dwarf_Op loc_intreg32[] = -+ { -+ { .atom = DW_OP_reg28 }, { .atom = DW_OP_piece, .number = 4 }, -+ { .atom = DW_OP_reg29 }, { .atom = DW_OP_piece, .number = 4 }, -+ }; -+ -+static const Dwarf_Op loc_intreg[] = -+ { -+ { .atom = DW_OP_reg28 }, { .atom = DW_OP_piece, .number = 8 }, -+ { .atom = DW_OP_reg29 }, { .atom = DW_OP_piece, .number = 8 }, -+ }; -+#define nloc_intreg 1 -+#define nloc_intregpair 4 -+ -+/* %fr4L, or pair %fr4L, %fr4R on pa-32 */ -+static const Dwarf_Op loc_fpreg32[] = -+ { -+ { .atom = DW_OP_regx, .number = 72 }, { .atom = DW_OP_piece, .number = 4 }, -+ { .atom = DW_OP_regx, .number = 73 }, { .atom = DW_OP_piece, .number = 4 }, -+ }; -+#define nloc_fpreg32 2 -+#define nloc_fpregpair32 4 -+ -+/* $fr4 */ -+static const Dwarf_Op loc_fpreg[] = -+ { -+ { .atom = DW_OP_regx, .number = 72 }, -+ }; -+#define nloc_fpreg 1 -+ -+#if 0 -+/* The return value is a structure and is actually stored in stack space -+ passed in a hidden argument by the caller. Address of the location is stored -+ in %r28 before function call, but it may be changed by function. */ -+static const Dwarf_Op loc_aggregate[] = -+ { -+ { .atom = DW_OP_breg28 }, -+ }; -+#define nloc_aggregate 1 -+#endif -+ -+static int -+parisc_return_value_location_ (Dwarf_Die *functypedie, const Dwarf_Op **locp, int pa64) -+{ -+ Dwarf_Word regsize = pa64 ? 8 : 4; -+ -+ /* Start with the function's type, and get the DW_AT_type attribute, -+ which is the type of the return value. */ -+ -+ Dwarf_Attribute attr_mem; -+ Dwarf_Attribute *attr = dwarf_attr_integrate (functypedie, DW_AT_type, &attr_mem); -+ if (attr == NULL) -+ /* The function has no return value, like a `void' function in C. */ -+ return 0; -+ -+ Dwarf_Die die_mem; -+ Dwarf_Die *typedie = dwarf_formref_die (attr, &die_mem); -+ int tag = dwarf_tag (typedie); -+ -+ /* Follow typedefs and qualifiers to get to the actual type. */ -+ while (tag == DW_TAG_typedef -+ || tag == DW_TAG_const_type || tag == DW_TAG_volatile_type -+ || tag == DW_TAG_restrict_type) -+ { -+ attr = dwarf_attr_integrate (typedie, DW_AT_type, &attr_mem); -+ typedie = dwarf_formref_die (attr, &die_mem); -+ tag = dwarf_tag (typedie); -+ } -+ -+ switch (tag) -+ { -+ case -1: -+ return -1; -+ -+ case DW_TAG_subrange_type: -+ if (! dwarf_hasattr_integrate (typedie, DW_AT_byte_size)) -+ { -+ attr = dwarf_attr_integrate (typedie, DW_AT_type, &attr_mem); -+ typedie = dwarf_formref_die (attr, &die_mem); -+ tag = dwarf_tag (typedie); -+ } -+ /* Fall through. */ -+ -+ case DW_TAG_base_type: -+ case DW_TAG_enumeration_type: -+ case DW_TAG_pointer_type: -+ case DW_TAG_ptr_to_member_type: -+ { -+ Dwarf_Word size; -+ if (dwarf_formudata (dwarf_attr_integrate (typedie, DW_AT_byte_size, -+ &attr_mem), &size) != 0) -+ { -+ if (tag == DW_TAG_pointer_type || tag == DW_TAG_ptr_to_member_type) -+ size = 4; -+ else -+ return -1; -+ } -+ if (tag == DW_TAG_base_type) -+ { -+ Dwarf_Word encoding; -+ if (dwarf_formudata (dwarf_attr_integrate (typedie, DW_AT_encoding, -+ &attr_mem), &encoding) != 0) -+ return -1; -+ -+ if (encoding == DW_ATE_float) -+ { -+ if (pa64) { -+ *locp = loc_fpreg; -+ if (size <= 8) -+ return nloc_fpreg; -+ } -+ else { -+ *locp = loc_fpreg32; -+ if (size <= 4) -+ return nloc_fpreg32; -+ else if (size <= 8) -+ return nloc_fpregpair32; -+ } -+ goto aggregate; -+ } -+ } -+ if (pa64) -+ *locp = loc_intreg; -+ else -+ *locp = loc_intreg32; -+ if (size <= regsize) -+ return nloc_intreg; -+ if (size <= 2 * regsize) -+ return nloc_intregpair; -+ -+ /* Else fall through. */ -+ } -+ -+ case DW_TAG_structure_type: -+ case DW_TAG_class_type: -+ case DW_TAG_union_type: -+ case DW_TAG_array_type: -+ aggregate: { -+ Dwarf_Word size; -+ if (dwarf_aggregate_size (typedie, &size) != 0) -+ return -1; -+ if (pa64) -+ *locp = loc_intreg; -+ else -+ *locp = loc_intreg32; -+ if (size <= regsize) -+ return nloc_intreg; -+ if (size <= 2 * regsize) -+ return nloc_intregpair; -+#if 0 -+ /* there should be some way to know this location... But I do not see it. */ -+ *locp = loc_aggregate; -+ return nloc_aggregate; -+#endif -+ /* fall through. */ -+ } -+ } -+ -+ /* XXX We don't have a good way to return specific errors from ebl calls. -+ This value means we do not understand the type, but it is well-formed -+ DWARF and might be valid. */ -+ return -2; -+} -+ -+int -+parisc_return_value_location_32 (Dwarf_Die *functypedie, const Dwarf_Op **locp) -+{ -+ return parisc_return_value_location_ (functypedie, locp, 0); -+} -+ -+int -+parisc_return_value_location_64 (Dwarf_Die *functypedie, const Dwarf_Op **locp) -+{ -+ return parisc_return_value_location_ (functypedie, locp, 1); -+} -+ -Index: elfutils-0.170/backends/parisc_symbol.c -=================================================================== ---- /dev/null -+++ elfutils-0.170/backends/parisc_symbol.c -@@ -0,0 +1,112 @@ -+/* PA-RISC specific symbolic name handling. -+ Copyright (C) 2002, 2005 Red Hat, Inc. -+ This file is part of Red Hat elfutils. -+ Written by Ulrich Drepper , 2002. -+ -+ Red Hat elfutils is free software; you can redistribute it and/or modify -+ it under the terms of the GNU General Public License as published by the -+ Free Software Foundation; version 2 of the License. -+ -+ Red Hat 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 a copy of the GNU General Public License along -+ with Red Hat elfutils; if not, write to the Free Software Foundation, -+ Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301 USA. -+ -+ Red Hat elfutils is an included package of the Open Invention Network. -+ An included package of the Open Invention Network is a package for which -+ Open Invention Network licensees cross-license their patents. No patent -+ license is granted, either expressly or impliedly, by designation as an -+ included package. Should you wish to participate in the Open Invention -+ Network licensing program, please visit www.openinventionnetwork.com -+ . */ -+ -+#ifdef HAVE_CONFIG_H -+# include -+#endif -+ -+#include -+#include -+ -+#define BACKEND parisc_ -+#include "libebl_CPU.h" -+ -+const char * -+parisc_segment_type_name (int segment, char *buf __attribute__ ((unused)), -+ size_t len __attribute__ ((unused))) -+{ -+ switch (segment) -+ { -+ case PT_PARISC_ARCHEXT: -+ return "PARISC_ARCHEXT"; -+ case PT_PARISC_UNWIND: -+ return "PARISC_UNWIND"; -+ default: -+ break; -+ } -+ return NULL; -+} -+ -+/* Return symbolic representation of symbol type. */ -+const char * -+parisc_symbol_type_name(int symbol, char *buf __attribute__ ((unused)), -+ size_t len __attribute__ ((unused))) -+{ -+ if (symbol == STT_PARISC_MILLICODE) -+ return "PARISC_MILLI"; -+ return NULL; -+} -+ -+/* Return symbolic representation of section type. */ -+const char * -+parisc_section_type_name (int type, -+ char *buf __attribute__ ((unused)), -+ size_t len __attribute__ ((unused))) -+{ -+ switch (type) -+ { -+ case SHT_PARISC_EXT: -+ return "PARISC_EXT"; -+ case SHT_PARISC_UNWIND: -+ return "PARISC_UNWIND"; -+ case SHT_PARISC_DOC: -+ return "PARISC_DOC"; -+ } -+ -+ return NULL; -+} -+ -+/* Check whether machine flags are valid. */ -+bool -+parisc_machine_flag_check (GElf_Word flags) -+{ -+ if (flags &~ (EF_PARISC_TRAPNIL | EF_PARISC_EXT | EF_PARISC_LSB | -+ EF_PARISC_WIDE | EF_PARISC_NO_KABP | -+ EF_PARISC_LAZYSWAP | EF_PARISC_ARCH)) -+ return 0; -+ -+ GElf_Word arch = flags & EF_PARISC_ARCH; -+ -+ return ((arch == EFA_PARISC_1_0) || (arch == EFA_PARISC_1_1) || -+ (arch == EFA_PARISC_2_0)); -+} -+ -+/* Check for the simple reloc types. */ -+Elf_Type -+parisc_reloc_simple_type (Ebl *ebl __attribute__ ((unused)), int type) -+{ -+ switch (type) -+ { -+ case R_PARISC_DIR64: -+ case R_PARISC_SECREL64: -+ return ELF_T_XWORD; -+ case R_PARISC_DIR32: -+ case R_PARISC_SECREL32: -+ return ELF_T_WORD; -+ default: -+ return ELF_T_NUM; -+ } -+} -Index: elfutils-0.170/backends/libebl_parisc.h -=================================================================== ---- /dev/null -+++ elfutils-0.170/backends/libebl_parisc.h -@@ -0,0 +1,9 @@ -+#ifndef _LIBEBL_HPPA_H -+#define _LIBEBL_HPPA_H 1 -+ -+#include -+ -+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.170/backends/Makefile.am -=================================================================== ---- elfutils-0.170.orig/backends/Makefile.am -+++ elfutils-0.170/backends/Makefile.am -@@ -33,12 +33,12 @@ AM_CPPFLAGS += -I$(top_srcdir)/libebl -I - - - modules = i386 sh x86_64 ia64 alpha arm aarch64 sparc ppc ppc64 s390 \ -- tilegx m68k bpf -+ tilegx m68k bpf 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_m68k_pic.a libebl_bpf_pic.a libebl_parisc_pic.a - noinst_LIBRARIES = $(libebl_pic) - noinst_DATA = $(libebl_pic:_pic.a=.so) - -@@ -124,6 +124,9 @@ cpu_bpf = ../libcpu/libcpu_bpf.a - libebl_bpf_pic_a_SOURCES = $(bpf_SRCS) - am_libebl_bpf_pic_a_OBJECTS = $(bpf_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.170/libelf/elf.h -=================================================================== ---- elfutils-0.170.orig/libelf/elf.h -+++ elfutils-0.170/libelf/elf.h -@@ -2056,16 +2056,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. */ -+#define R_PARISC_DPREL14WR 19 -+#define R_PARISC_DPREL14DR 20 - #define R_PARISC_DPREL14R 22 /* Right 14 bits of rel. address. */ - #define R_PARISC_GPREL21L 26 /* GP-relative, left 21 bits. */ - #define R_PARISC_GPREL14R 30 /* GP-relative, right 14 bits. */ - #define R_PARISC_LTOFF21L 34 /* LT-relative, left 21 bits. */ - #define R_PARISC_LTOFF14R 38 /* LT-relative, right 14 bits. */ -+#define R_PARISC_DLTIND14F 39 -+#define R_PARISC_SETBASE 40 - #define R_PARISC_SECREL32 41 /* 32 bits section rel. address. */ -+#define R_PARISC_BASEREL21L 42 -+#define R_PARISC_BASEREL17R 43 -+#define R_PARISC_BASEREL14R 46 - #define R_PARISC_SEGBASE 48 /* No relocation, set segment base. */ - #define R_PARISC_SEGREL32 49 /* 32 bits segment rel. address. */ - #define R_PARISC_PLTOFF21L 50 /* PLT rel. address, left 21 bits. */ - #define R_PARISC_PLTOFF14R 54 /* PLT rel. address, right 14 bits. */ -+#define R_PARISC_PLTOFF14F 55 - #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. */ -@@ -2074,6 +2082,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. */ -+#define R_PARISC_PCREL22C 73 - #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. */ -@@ -2099,6 +2108,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. */ -+#define R_PARISC_BASEREL14WR 107 -+#define R_PARISC_BASEREL14DR 108 - #define R_PARISC_SEGREL64 112 /* 64 bits segment rel. address. */ - #define R_PARISC_PLTOFF14WR 115 /* PLT-rel. address, right 14 bits. */ - #define R_PARISC_PLTOFF14DR 116 /* PLT-rel. address, right 14 bits. */ diff --git a/meta/recipes-devtools/elfutils/files/debian/hurd_path.patch b/meta/recipes-devtools/elfutils/files/debian/hurd_path.patch new file mode 100644 index 0000000000..4440e39e0a --- /dev/null +++ b/meta/recipes-devtools/elfutils/files/debian/hurd_path.patch @@ -0,0 +1,14 @@ +Index: elfutils-0.165/tests/run-native-test.sh +=================================================================== +--- elfutils-0.165.orig/tests/run-native-test.sh ++++ elfutils-0.165/tests/run-native-test.sh +@@ -83,6 +83,9 @@ native_test() + # "cannot attach to process: Function not implemented". + [ "$(uname)" = "GNU/kFreeBSD" ] && exit 77 + ++# hurd's /proc/$PID/maps does not give paths yet. ++[ "$(uname)" = "GNU" ] && exit 77 ++ + native_test ${abs_builddir}/allregs + native_test ${abs_builddir}/funcretval + diff --git a/meta/recipes-devtools/elfutils/files/debian/ignore_strmerge.diff b/meta/recipes-devtools/elfutils/files/debian/ignore_strmerge.diff new file mode 100644 index 0000000000..1e6d7a2de6 --- /dev/null +++ b/meta/recipes-devtools/elfutils/files/debian/ignore_strmerge.diff @@ -0,0 +1,11 @@ +--- elfutils-0.165.orig/tests/run-strip-strmerge.sh ++++ elfutils-0.165/tests/run-strip-strmerge.sh +@@ -30,7 +30,7 @@ remerged=remerged.elf + tempfiles $merged $stripped $debugfile $remerged + + echo elflint $input +-testrun ${abs_top_builddir}/src/elflint --gnu $input ++testrun_on_self_skip ${abs_top_builddir}/src/elflint --gnu $input + echo elfstrmerge + testrun ${abs_top_builddir}/tests/elfstrmerge -o $merged $input + echo elflint $merged diff --git a/meta/recipes-devtools/elfutils/files/debian/kfreebsd_path.patch b/meta/recipes-devtools/elfutils/files/debian/kfreebsd_path.patch new file mode 100644 index 0000000000..9a19b58b50 --- /dev/null +++ b/meta/recipes-devtools/elfutils/files/debian/kfreebsd_path.patch @@ -0,0 +1,17 @@ +Index: b/tests/run-native-test.sh +=================================================================== +--- a/tests/run-native-test.sh ++++ b/tests/run-native-test.sh +@@ -77,6 +77,12 @@ native_test() + test $native -eq 0 || testrun "$@" -p $native > /dev/null + } + ++# On the Debian buildds, GNU/kFreeBSD linprocfs /proc/$PID/maps does ++# not give absolute paths due to sbuild's bind mounts (bug #570805) ++# therefore the next two test programs are expected to fail with ++# "cannot attach to process: Function not implemented". ++[ "$(uname)" = "GNU/kFreeBSD" ] && exit 77 ++ + native_test ${abs_builddir}/allregs + native_test ${abs_builddir}/funcretval + diff --git a/meta/recipes-devtools/elfutils/files/debian/mips_backend.patch b/meta/recipes-devtools/elfutils/files/debian/mips_backend.patch deleted file mode 100644 index 2e0e54b0c7..0000000000 --- a/meta/recipes-devtools/elfutils/files/debian/mips_backend.patch +++ /dev/null @@ -1,715 +0,0 @@ -From 46d0d0ca718093486eeeedf1b44134e9e29b56f7 Mon Sep 17 00:00:00 2001 -From: Hongxu Jia -Date: Wed, 16 Aug 2017 09:18:59 +0800 -Subject: [PATCH] mips backends - -Upstream-Status: Backport [from debian] - -Rebase to 0.170 -Signed-off-by: Hongxu Jia ---- - backends/Makefile.am | 8 +- - backends/mips_init.c | 59 +++++++++ - backends/mips_regs.c | 104 ++++++++++++++++ - backends/mips_reloc.def | 79 ++++++++++++ - backends/mips_retval.c | 321 ++++++++++++++++++++++++++++++++++++++++++++++++ - backends/mips_symbol.c | 52 ++++++++ - libebl/eblopenbackend.c | 2 + - 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 7f1f5d4..91baf6e 100644 ---- a/backends/Makefile.am -+++ b/backends/Makefile.am -@@ -33,12 +33,12 @@ AM_CPPFLAGS += -I$(top_srcdir)/libebl -I$(top_srcdir)/libasm \ - - - modules = i386 sh x86_64 ia64 alpha arm aarch64 sparc ppc ppc64 s390 \ -- tilegx m68k bpf parisc -+ tilegx m68k bpf 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_parisc_pic.a -+ libebl_m68k_pic.a libebl_bpf_pic.a libebl_parisc_pic.a libebl_mips_pic.a - noinst_LIBRARIES = $(libebl_pic) - noinst_DATA = $(libebl_pic:_pic.a=.so) - -@@ -128,6 +128,10 @@ 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) - -+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: *; };' \ -diff --git a/backends/mips_init.c b/backends/mips_init.c -new file mode 100644 -index 0000000..975c04e ---- /dev/null -+++ b/backends/mips_init.c -@@ -0,0 +1,59 @@ -+/* Initialization of mips specific backend library. -+ Copyright (C) 2006 Red Hat, Inc. -+ This file is part of Red Hat elfutils. -+ -+ Red Hat elfutils is free software; you can redistribute it and/or modify -+ it under the terms of the GNU General Public License as published by the -+ Free Software Foundation; version 2 of the License. -+ -+ Red Hat 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 a copy of the GNU General Public License along -+ with Red Hat elfutils; if not, write to the Free Software Foundation, -+ Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301 USA. -+ -+ Red Hat elfutils is an included package of the Open Invention Network. -+ An included package of the Open Invention Network is a package for which -+ Open Invention Network licensees cross-license their patents. No patent -+ license is granted, either expressly or impliedly, by designation as an -+ included package. Should you wish to participate in the Open Invention -+ Network licensing program, please visit www.openinventionnetwork.com -+ . */ -+ -+#ifdef HAVE_CONFIG_H -+# include -+#endif -+ -+#define BACKEND mips_ -+#define RELOC_PREFIX R_MIPS_ -+#include "libebl_CPU.h" -+ -+/* This defines the common reloc hooks based on mips_reloc.def. */ -+#include "common-reloc.c" -+ -+const char * -+mips_init (Elf *elf __attribute__ ((unused)), -+ GElf_Half machine __attribute__ ((unused)), -+ Ebl *eh, -+ size_t ehlen) -+{ -+ /* Check whether the Elf_BH object has a sufficent size. */ -+ if (ehlen < sizeof (Ebl)) -+ return NULL; -+ -+ /* We handle it. */ -+ if (machine == EM_MIPS) -+ eh->name = "MIPS R3000 big-endian"; -+ else if (machine == EM_MIPS_RS3_LE) -+ eh->name = "MIPS R3000 little-endian"; -+ -+ mips_init_reloc (eh); -+ HOOK (eh, reloc_simple_type); -+ HOOK (eh, return_value_location); -+ HOOK (eh, register_info); -+ -+ return MODVERSION; -+} -diff --git a/backends/mips_regs.c b/backends/mips_regs.c -new file mode 100644 -index 0000000..44f86cb ---- /dev/null -+++ b/backends/mips_regs.c -@@ -0,0 +1,104 @@ -+/* Register names and numbers for MIPS DWARF. -+ Copyright (C) 2006 Red Hat, Inc. -+ This file is part of Red Hat elfutils. -+ -+ Red Hat elfutils is free software; you can redistribute it and/or modify -+ it under the terms of the GNU General Public License as published by the -+ Free Software Foundation; version 2 of the License. -+ -+ Red Hat 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 a copy of the GNU General Public License along -+ with Red Hat elfutils; if not, write to the Free Software Foundation, -+ Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301 USA. -+ -+ Red Hat elfutils is an included package of the Open Invention Network. -+ An included package of the Open Invention Network is a package for which -+ Open Invention Network licensees cross-license their patents. No patent -+ license is granted, either expressly or impliedly, by designation as an -+ included package. Should you wish to participate in the Open Invention -+ Network licensing program, please visit www.openinventionnetwork.com -+ . */ -+ -+#ifdef HAVE_CONFIG_H -+# include -+#endif -+ -+#include -+#include -+ -+#define BACKEND mips_ -+#include "libebl_CPU.h" -+ -+ssize_t -+mips_register_info (Ebl *ebl __attribute__((unused)), -+ int regno, char *name, size_t namelen, -+ const char **prefix, const char **setname, -+ int *bits, int *type) -+{ -+ if (name == NULL) -+ return 66; -+ -+ if (regno < 0 || regno > 65 || namelen < 4) -+ return -1; -+ -+ *prefix = "$"; -+ -+ if (regno < 32) -+ { -+ *setname = "integer"; -+ *type = DW_ATE_signed; -+ *bits = 32; -+ if (regno < 32 + 10) -+ { -+ name[0] = regno + '0'; -+ namelen = 1; -+ } -+ else -+ { -+ name[0] = (regno / 10) + '0'; -+ name[1] = (regno % 10) + '0'; -+ namelen = 2; -+ } -+ } -+ else if (regno < 64) -+ { -+ *setname = "FPU"; -+ *type = DW_ATE_float; -+ *bits = 32; -+ name[0] = 'f'; -+ if (regno < 32 + 10) -+ { -+ name[1] = (regno - 32) + '0'; -+ namelen = 2; -+ } -+ else -+ { -+ name[1] = (regno - 32) / 10 + '0'; -+ name[2] = (regno - 32) % 10 + '0'; -+ namelen = 3; -+ } -+ } -+ else if (regno == 64) -+ { -+ *type = DW_ATE_signed; -+ *bits = 32; -+ name[0] = 'h'; -+ name[1] = 'i'; -+ namelen = 2; -+ } -+ else -+ { -+ *type = DW_ATE_signed; -+ *bits = 32; -+ name[0] = 'l'; -+ name[1] = 'o'; -+ namelen = 2; -+ } -+ -+ name[namelen++] = '\0'; -+ return namelen; -+} -diff --git a/backends/mips_reloc.def b/backends/mips_reloc.def -new file mode 100644 -index 0000000..4579970 ---- /dev/null -+++ b/backends/mips_reloc.def -@@ -0,0 +1,79 @@ -+/* List the relocation types for mips. -*- C -*- -+ Copyright (C) 2006 Red Hat, Inc. -+ This file is part of Red Hat elfutils. -+ -+ Red Hat elfutils is free software; you can redistribute it and/or modify -+ it under the terms of the GNU General Public License as published by the -+ Free Software Foundation; version 2 of the License. -+ -+ Red Hat 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 a copy of the GNU General Public License along -+ with Red Hat elfutils; if not, write to the Free Software Foundation, -+ Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301 USA. -+ -+ Red Hat elfutils is an included package of the Open Invention Network. -+ An included package of the Open Invention Network is a package for which -+ Open Invention Network licensees cross-license their patents. No patent -+ license is granted, either expressly or impliedly, by designation as an -+ included package. Should you wish to participate in the Open Invention -+ Network licensing program, please visit www.openinventionnetwork.com -+ . */ -+ -+/* NAME, REL|EXEC|DYN */ -+ -+RELOC_TYPE (NONE, 0) -+RELOC_TYPE (16, 0) -+RELOC_TYPE (32, 0) -+RELOC_TYPE (REL32, 0) -+RELOC_TYPE (26, 0) -+RELOC_TYPE (HI16, 0) -+RELOC_TYPE (LO16, 0) -+RELOC_TYPE (GPREL16, 0) -+RELOC_TYPE (LITERAL, 0) -+RELOC_TYPE (GOT16, 0) -+RELOC_TYPE (PC16, 0) -+RELOC_TYPE (CALL16, 0) -+RELOC_TYPE (GPREL32, 0) -+ -+RELOC_TYPE (SHIFT5, 0) -+RELOC_TYPE (SHIFT6, 0) -+RELOC_TYPE (64, 0) -+RELOC_TYPE (GOT_DISP, 0) -+RELOC_TYPE (GOT_PAGE, 0) -+RELOC_TYPE (GOT_OFST, 0) -+RELOC_TYPE (GOT_HI16, 0) -+RELOC_TYPE (GOT_LO16, 0) -+RELOC_TYPE (SUB, 0) -+RELOC_TYPE (INSERT_A, 0) -+RELOC_TYPE (INSERT_B, 0) -+RELOC_TYPE (DELETE, 0) -+RELOC_TYPE (HIGHER, 0) -+RELOC_TYPE (HIGHEST, 0) -+RELOC_TYPE (CALL_HI16, 0) -+RELOC_TYPE (CALL_LO16, 0) -+RELOC_TYPE (SCN_DISP, 0) -+RELOC_TYPE (REL16, 0) -+RELOC_TYPE (ADD_IMMEDIATE, 0) -+RELOC_TYPE (PJUMP, 0) -+RELOC_TYPE (RELGOT, 0) -+RELOC_TYPE (JALR, 0) -+RELOC_TYPE (TLS_DTPMOD32, 0) -+RELOC_TYPE (TLS_DTPREL32, 0) -+RELOC_TYPE (TLS_DTPMOD64, 0) -+RELOC_TYPE (TLS_DTPREL64, 0) -+RELOC_TYPE (TLS_GD, 0) -+RELOC_TYPE (TLS_LDM, 0) -+RELOC_TYPE (TLS_DTPREL_HI16, 0) -+RELOC_TYPE (TLS_DTPREL_LO16, 0) -+RELOC_TYPE (TLS_GOTTPREL, 0) -+RELOC_TYPE (TLS_TPREL32, 0) -+RELOC_TYPE (TLS_TPREL64, 0) -+RELOC_TYPE (TLS_TPREL_HI16, 0) -+RELOC_TYPE (TLS_TPREL_LO16, 0) -+ -+#define NO_COPY_RELOC 1 -+#define NO_RELATIVE_RELOC 1 -diff --git a/backends/mips_retval.c b/backends/mips_retval.c -new file mode 100644 -index 0000000..656cd1f ---- /dev/null -+++ b/backends/mips_retval.c -@@ -0,0 +1,321 @@ -+/* Function return value location for Linux/mips ABI. -+ Copyright (C) 2005 Red Hat, Inc. -+ This file is part of Red Hat elfutils. -+ -+ Red Hat elfutils is free software; you can redistribute it and/or modify -+ it under the terms of the GNU General Public License as published by the -+ Free Software Foundation; version 2 of the License. -+ -+ Red Hat 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 a copy of the GNU General Public License along -+ with Red Hat elfutils; if not, write to the Free Software Foundation, -+ Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301 USA. -+ -+ Red Hat elfutils is an included package of the Open Invention Network. -+ An included package of the Open Invention Network is a package for which -+ Open Invention Network licensees cross-license their patents. No patent -+ license is granted, either expressly or impliedly, by designation as an -+ included package. Should you wish to participate in the Open Invention -+ Network licensing program, please visit www.openinventionnetwork.com -+ . */ -+ -+#ifdef HAVE_CONFIG_H -+# include -+#endif -+ -+#include -+#include -+#include -+#include -+ -+#include "../libebl/libeblP.h" -+#include "../libdw/libdwP.h" -+ -+#define BACKEND mips_ -+#include "libebl_CPU.h" -+ -+/* The ABI of the file. Also see EF_MIPS_ABI2 above. */ -+#define EF_MIPS_ABI 0x0000F000 -+ -+/* The original o32 abi. */ -+#define E_MIPS_ABI_O32 0x00001000 -+ -+/* O32 extended to work on 64 bit architectures */ -+#define E_MIPS_ABI_O64 0x00002000 -+ -+/* EABI in 32 bit mode */ -+#define E_MIPS_ABI_EABI32 0x00003000 -+ -+/* EABI in 64 bit mode */ -+#define E_MIPS_ABI_EABI64 0x00004000 -+ -+/* All the possible MIPS ABIs. */ -+enum mips_abi -+ { -+ MIPS_ABI_UNKNOWN = 0, -+ MIPS_ABI_N32, -+ MIPS_ABI_O32, -+ MIPS_ABI_N64, -+ MIPS_ABI_O64, -+ MIPS_ABI_EABI32, -+ MIPS_ABI_EABI64, -+ MIPS_ABI_LAST -+ }; -+ -+/* Find the mips ABI of the current file */ -+enum mips_abi find_mips_abi(Elf *elf) -+{ -+ GElf_Ehdr ehdr_mem; -+ GElf_Ehdr *ehdr = gelf_getehdr (elf, &ehdr_mem); -+ -+ if (ehdr == NULL) -+ return MIPS_ABI_LAST; -+ -+ GElf_Word elf_flags = ehdr->e_flags; -+ -+ /* Check elf_flags to see if it specifies the ABI being used. */ -+ switch ((elf_flags & EF_MIPS_ABI)) -+ { -+ case E_MIPS_ABI_O32: -+ return MIPS_ABI_O32; -+ case E_MIPS_ABI_O64: -+ return MIPS_ABI_O64; -+ case E_MIPS_ABI_EABI32: -+ return MIPS_ABI_EABI32; -+ case E_MIPS_ABI_EABI64: -+ return MIPS_ABI_EABI64; -+ default: -+ if ((elf_flags & EF_MIPS_ABI2)) -+ return MIPS_ABI_N32; -+ } -+ -+ /* GCC creates a pseudo-section whose name describes the ABI. */ -+ size_t shstrndx; -+ if (elf_getshdrstrndx (elf, &shstrndx) < 0) -+ return MIPS_ABI_LAST; -+ -+ const char *name; -+ Elf_Scn *scn = NULL; -+ while ((scn = elf_nextscn (elf, scn)) != NULL) -+ { -+ GElf_Shdr shdr_mem; -+ GElf_Shdr *shdr = gelf_getshdr (scn, &shdr_mem); -+ if (shdr == NULL) -+ return MIPS_ABI_LAST; -+ -+ name = elf_strptr (elf, shstrndx, shdr->sh_name) ?: ""; -+ if (strncmp (name, ".mdebug.", 8) != 0) -+ continue; -+ -+ if (strcmp (name, ".mdebug.abi32") == 0) -+ return MIPS_ABI_O32; -+ else if (strcmp (name, ".mdebug.abiN32") == 0) -+ return MIPS_ABI_N32; -+ else if (strcmp (name, ".mdebug.abi64") == 0) -+ return MIPS_ABI_N64; -+ else if (strcmp (name, ".mdebug.abiO64") == 0) -+ return MIPS_ABI_O64; -+ else if (strcmp (name, ".mdebug.eabi32") == 0) -+ return MIPS_ABI_EABI32; -+ else if (strcmp (name, ".mdebug.eabi64") == 0) -+ return MIPS_ABI_EABI64; -+ else -+ return MIPS_ABI_UNKNOWN; -+ } -+ -+ return MIPS_ABI_UNKNOWN; -+} -+ -+unsigned int -+mips_abi_regsize (enum mips_abi abi) -+{ -+ switch (abi) -+ { -+ case MIPS_ABI_EABI32: -+ case MIPS_ABI_O32: -+ return 4; -+ case MIPS_ABI_N32: -+ case MIPS_ABI_N64: -+ case MIPS_ABI_O64: -+ case MIPS_ABI_EABI64: -+ return 8; -+ case MIPS_ABI_UNKNOWN: -+ case MIPS_ABI_LAST: -+ default: -+ return 0; -+ } -+} -+ -+ -+/* $v0 or pair $v0, $v1 */ -+static const Dwarf_Op loc_intreg_o32[] = -+ { -+ { .atom = DW_OP_reg2 }, { .atom = DW_OP_piece, .number = 4 }, -+ { .atom = DW_OP_reg3 }, { .atom = DW_OP_piece, .number = 4 }, -+ }; -+ -+static const Dwarf_Op loc_intreg[] = -+ { -+ { .atom = DW_OP_reg2 }, { .atom = DW_OP_piece, .number = 8 }, -+ { .atom = DW_OP_reg3 }, { .atom = DW_OP_piece, .number = 8 }, -+ }; -+#define nloc_intreg 1 -+#define nloc_intregpair 4 -+ -+/* $f0 (float), or pair $f0, $f1 (double). -+ * f2/f3 are used for COMPLEX (= 2 doubles) returns in Fortran */ -+static const Dwarf_Op loc_fpreg_o32[] = -+ { -+ { .atom = DW_OP_regx, .number = 32 }, { .atom = DW_OP_piece, .number = 4 }, -+ { .atom = DW_OP_regx, .number = 33 }, { .atom = DW_OP_piece, .number = 4 }, -+ { .atom = DW_OP_regx, .number = 34 }, { .atom = DW_OP_piece, .number = 4 }, -+ { .atom = DW_OP_regx, .number = 35 }, { .atom = DW_OP_piece, .number = 4 }, -+ }; -+ -+/* $f0, or pair $f0, $f2. */ -+static const Dwarf_Op loc_fpreg[] = -+ { -+ { .atom = DW_OP_regx, .number = 32 }, { .atom = DW_OP_piece, .number = 8 }, -+ { .atom = DW_OP_regx, .number = 34 }, { .atom = DW_OP_piece, .number = 8 }, -+ }; -+#define nloc_fpreg 1 -+#define nloc_fpregpair 4 -+#define nloc_fpregquad 8 -+ -+/* The return value is a structure and is actually stored in stack space -+ passed in a hidden argument by the caller. But, the compiler -+ helpfully returns the address of that space in $v0. */ -+static const Dwarf_Op loc_aggregate[] = -+ { -+ { .atom = DW_OP_breg2, .number = 0 } -+ }; -+#define nloc_aggregate 1 -+ -+int -+mips_return_value_location (Dwarf_Die *functypedie, const Dwarf_Op **locp) -+{ -+ /* First find the ABI used by the elf object */ -+ enum mips_abi abi = find_mips_abi(functypedie->cu->dbg->elf); -+ -+ /* Something went seriously wrong while trying to figure out the ABI */ -+ if (abi == MIPS_ABI_LAST) -+ return -1; -+ -+ /* We couldn't identify the ABI, but the file seems valid */ -+ if (abi == MIPS_ABI_UNKNOWN) -+ return -2; -+ -+ /* Can't handle EABI variants */ -+ if ((abi == MIPS_ABI_EABI32) || (abi == MIPS_ABI_EABI64)) -+ return -2; -+ -+ unsigned int regsize = mips_abi_regsize (abi); -+ if (!regsize) -+ return -2; -+ -+ /* Start with the function's type, and get the DW_AT_type attribute, -+ which is the type of the return value. */ -+ -+ Dwarf_Attribute attr_mem; -+ Dwarf_Attribute *attr = dwarf_attr_integrate (functypedie, DW_AT_type, &attr_mem); -+ if (attr == NULL) -+ /* The function has no return value, like a `void' function in C. */ -+ return 0; -+ -+ Dwarf_Die die_mem; -+ Dwarf_Die *typedie = dwarf_formref_die (attr, &die_mem); -+ int tag = dwarf_tag (typedie); -+ -+ /* Follow typedefs and qualifiers to get to the actual type. */ -+ while (tag == DW_TAG_typedef -+ || tag == DW_TAG_const_type || tag == DW_TAG_volatile_type -+ || tag == DW_TAG_restrict_type) -+ { -+ attr = dwarf_attr_integrate (typedie, DW_AT_type, &attr_mem); -+ typedie = dwarf_formref_die (attr, &die_mem); -+ tag = dwarf_tag (typedie); -+ } -+ -+ switch (tag) -+ { -+ case -1: -+ return -1; -+ -+ case DW_TAG_subrange_type: -+ if (! dwarf_hasattr_integrate (typedie, DW_AT_byte_size)) -+ { -+ attr = dwarf_attr_integrate (typedie, DW_AT_type, &attr_mem); -+ typedie = dwarf_formref_die (attr, &die_mem); -+ tag = dwarf_tag (typedie); -+ } -+ /* Fall through. */ -+ -+ case DW_TAG_base_type: -+ case DW_TAG_enumeration_type: -+ case DW_TAG_pointer_type: -+ case DW_TAG_ptr_to_member_type: -+ { -+ Dwarf_Word size; -+ if (dwarf_formudata (dwarf_attr_integrate (typedie, DW_AT_byte_size, -+ &attr_mem), &size) != 0) -+ { -+ if (tag == DW_TAG_pointer_type || tag == DW_TAG_ptr_to_member_type) -+ size = regsize; -+ else -+ return -1; -+ } -+ if (tag == DW_TAG_base_type) -+ { -+ Dwarf_Word encoding; -+ if (dwarf_formudata (dwarf_attr_integrate (typedie, DW_AT_encoding, -+ &attr_mem), &encoding) != 0) -+ return -1; -+ -+#define ABI_LOC(loc, regsize) ((regsize) == 4 ? (loc ## _o32) : (loc)) -+ -+ if (encoding == DW_ATE_float) -+ { -+ *locp = ABI_LOC(loc_fpreg, regsize); -+ if (size <= regsize) -+ return nloc_fpreg; -+ -+ if (size <= 2*regsize) -+ return nloc_fpregpair; -+ -+ if (size <= 4*regsize && abi == MIPS_ABI_O32) -+ return nloc_fpregquad; -+ -+ goto aggregate; -+ } -+ } -+ *locp = ABI_LOC(loc_intreg, regsize); -+ if (size <= regsize) -+ return nloc_intreg; -+ if (size <= 2*regsize) -+ return nloc_intregpair; -+ -+ /* Else fall through. Shouldn't happen though (at least with gcc) */ -+ } -+ -+ case DW_TAG_structure_type: -+ case DW_TAG_class_type: -+ case DW_TAG_union_type: -+ case DW_TAG_array_type: -+ aggregate: -+ /* XXX TODO: Can't handle structure return with other ABI's yet :-/ */ -+ if ((abi != MIPS_ABI_O32) && (abi != MIPS_ABI_O64)) -+ return -2; -+ -+ *locp = loc_aggregate; -+ return nloc_aggregate; -+ } -+ -+ /* XXX We don't have a good way to return specific errors from ebl calls. -+ This value means we do not understand the type, but it is well-formed -+ DWARF and might be valid. */ -+ return -2; -+} -diff --git a/backends/mips_symbol.c b/backends/mips_symbol.c -new file mode 100644 -index 0000000..ba465fe ---- /dev/null -+++ b/backends/mips_symbol.c -@@ -0,0 +1,52 @@ -+/* MIPS specific symbolic name handling. -+ Copyright (C) 2002, 2003, 2005 Red Hat, Inc. -+ This file is part of Red Hat elfutils. -+ Written by Jakub Jelinek , 2002. -+ -+ Red Hat elfutils is free software; you can redistribute it and/or modify -+ it under the terms of the GNU General Public License as published by the -+ Free Software Foundation; version 2 of the License. -+ -+ Red Hat 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 a copy of the GNU General Public License along -+ with Red Hat elfutils; if not, write to the Free Software Foundation, -+ Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301 USA. -+ -+ Red Hat elfutils is an included package of the Open Invention Network. -+ An included package of the Open Invention Network is a package for which -+ Open Invention Network licensees cross-license their patents. No patent -+ license is granted, either expressly or impliedly, by designation as an -+ included package. Should you wish to participate in the Open Invention -+ Network licensing program, please visit www.openinventionnetwork.com -+ . */ -+ -+#ifdef HAVE_CONFIG_H -+# include -+#endif -+ -+#include -+#include -+ -+#define BACKEND mips_ -+#include "libebl_CPU.h" -+ -+/* Check for the simple reloc types. */ -+Elf_Type -+mips_reloc_simple_type (Ebl *ebl __attribute__ ((unused)), int type) -+{ -+ switch (type) -+ { -+ case R_MIPS_16: -+ return ELF_T_HALF; -+ case R_MIPS_32: -+ return ELF_T_WORD; -+ case R_MIPS_64: -+ return ELF_T_XWORD; -+ default: -+ return ELF_T_NUM; -+ } -+} -diff --git a/libebl/eblopenbackend.c b/libebl/eblopenbackend.c -index 1f81477..5371396 100644 ---- a/libebl/eblopenbackend.c -+++ b/libebl/eblopenbackend.c -@@ -72,6 +72,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 }, --- -1.8.3.1 - diff --git a/meta/recipes-devtools/elfutils/files/debian/mips_readelf_w.patch b/meta/recipes-devtools/elfutils/files/debian/mips_readelf_w.patch deleted file mode 100644 index 790930cf35..0000000000 --- a/meta/recipes-devtools/elfutils/files/debian/mips_readelf_w.patch +++ /dev/null @@ -1,25 +0,0 @@ -From: Kurt Roeckx -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. - -Upstream-Status: Backport [from debian] -Signed-off-by: Hongxu Jia - -Index: b/src/readelf.c -=================================================================== ---- a/src/readelf.c -+++ b/src/readelf.c -@@ -8343,7 +8343,8 @@ print_debug (Dwfl_Module *dwflmod, Ebl * - GElf_Shdr shdr_mem; - GElf_Shdr *shdr = gelf_getshdr (scn, &shdr_mem); - -- if (shdr != NULL && shdr->sh_type == SHT_PROGBITS) -+ if (shdr != NULL && ( -+ (shdr->sh_type == SHT_PROGBITS) || (shdr->sh_type == SHT_MIPS_DWARF))) - { - static const struct - { -- cgit v1.2.3-54-g00ecf