summaryrefslogtreecommitdiff
path: root/dev-util/debugedit
diff options
context:
space:
mode:
authorV3n3RiX <venerix@redcorelinux.org>2021-09-03 20:56:28 +0100
committerV3n3RiX <venerix@redcorelinux.org>2021-09-03 20:56:28 +0100
commitfbda87924e6faa7a1919f1a2b4182490bde5ec5c (patch)
treef3114a4ed212a754756adce027aeef3a4a1a2e2a /dev-util/debugedit
parent3b08f674e3f771b49370edb144dab0958c8cf721 (diff)
gentoo resync : 03.09.2021
Diffstat (limited to 'dev-util/debugedit')
-rw-r--r--dev-util/debugedit/Manifest5
-rw-r--r--dev-util/debugedit/debugedit-5.0.ebuild42
-rw-r--r--dev-util/debugedit/files/debugedit-5.0-readelf.patch330
-rw-r--r--dev-util/debugedit/files/debugedit-5.0-zero-dir-entry.patch130
4 files changed, 507 insertions, 0 deletions
diff --git a/dev-util/debugedit/Manifest b/dev-util/debugedit/Manifest
index a0f6ed1810dd..53a88ffe6296 100644
--- a/dev-util/debugedit/Manifest
+++ b/dev-util/debugedit/Manifest
@@ -1,3 +1,8 @@
+AUX debugedit-5.0-readelf.patch 13298 BLAKE2B 40a561495ea4186c9565482c73f24fc5dfc2842e3a681fe988dfcca71aa518a95deb08f9423455bb23a38c05d6e7c641050519dc5ce0756732347293e8bcdcbe SHA512 0a2fd64a2716a720fd8d25929a9369d3691ece63af6bae363246766c60055c0441b821934df13e4fd70f3464e072c8f0f2d18634d7dadbb0fa253704ce4e658f
+AUX debugedit-5.0-zero-dir-entry.patch 4172 BLAKE2B 8eddb4deb23304576df6730e4b5b517ea700c8be6d5b2617dc51cc27b975b07fbaccbe2ab656dff99287fdcd7f1f13dc8c3f3fc4378ef7edad26d83e8b688848 SHA512 f9f3a3db717033f7a4909d66d938051e525a6e6ebc238e898d54b503b9e4e99b068c04be4b57454fc188cfcd2cd56e2528875613c24da94ce5931a1b60942cb2
+DIST debugedit-5.0.tar.xz 164820 BLAKE2B 8e79f930a7e5c91709b1646794412836fff0b08da17a4b54beac4752a3f62c7418e3e8b8f7f3c3111ba375d6c672fee0f4279632bab3fb406a2fdd75a9e81a64 SHA512 7e7f529eafe41b53f0b5bfc58282fdbfa0dfa93ed7908b70e81942d6d2b6f80fc9c6bff2ed9674fd98947e5750b615f4c8b222544989e2900c5f8ff5ae0efb92
+DIST debugedit-5.0.tar.xz.sig 310 BLAKE2B bd8b092e400575fa62f759e4fd2e6bbfc9dbd77da2a363bd13c98b32794d515fbe7987824874b9c4be048e458c334bccb74082a78d845f07429b150083f2bcbf SHA512 2223841eb6c63616dc24028e8076ab9d82579e8d6efa4bba45e5dbd0eb181c947feae6f944136f3504a78678569ae96dc6c4a0dd4e7012bd9aa522b0f7525dc9
DIST rpm-4.16.1.3.tar.bz2 4354652 BLAKE2B 10013014bdeaf908b64c90f8e76f1d4b0cd0e8cb926f0cd979d7b1e1963b9a25c5b98531deea7e74e00168e2e6349f443fa4578c69c717ca1ab5e6b79d801f3a SHA512 54e503b32dffaa73d6168f26a00220d9d9124082d8a1eb1ddf34ce32a482f07cb06ec654cf065fca1607cc37b13fa7d4fa9895553541d7cfddecf68c9eb96f2e
EBUILD debugedit-4.16.1.3.ebuild 1778 BLAKE2B fb9b687a9f514cf77455b757e5e908d0f43672848b9f77a62f8040cb7c5951886e4b203ba9326b4a67a0db01c5a4272579fb498948cb817c179b006e6c2dbfe1 SHA512 2446eed2b524a754520fd974d018a2a0b4b88cb0ac5f4ee11bfd3b86e98faf77d1d153600f77fc67bdb865bc542da862f21387aa8bb9c9d0ed01cba87b26f7c9
+EBUILD debugedit-5.0.ebuild 878 BLAKE2B 4bdfc32e525e626c6171dd793d78c6a1067e09d913799ea763c854a85bdea967a36eddb6717e3725d41151c4ff1d9296d07953abb9eab16e1e7705b00bccad67 SHA512 0e62fd215036c5aa890891898bc52d26ddb713e6b036f7430f162d7273d73f67c680500e0bbce635242ccf14bd6ee2213152b9bea15b380fe82f3c99b39efffe
MISC metadata.xml 247 BLAKE2B 1750cec57189e711ca5eba89a78e1d317f0839fa53564fbd39b4e955c28d98f4ae04caf9069afc20a18536cdc92b30fe7b15eb086767c742bad07d9980cfd24b SHA512 d6e2ea8a9d74791bcbf3d6311a66bafc20b8f4db3a576d9a8d54b86d7afb231122b8d87f71f3f46360980adf8d815c633b6d5041f9a30fc8656e8fb66057a282
diff --git a/dev-util/debugedit/debugedit-5.0.ebuild b/dev-util/debugedit/debugedit-5.0.ebuild
new file mode 100644
index 000000000000..ebbfafad2c19
--- /dev/null
+++ b/dev-util/debugedit/debugedit-5.0.ebuild
@@ -0,0 +1,42 @@
+# Copyright 1999-2021 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+
+inherit autotools verify-sig
+
+DESCRIPTION="Create debuginfo and source file distributions"
+HOMEPAGE="https://sourceware.org/debugedit/"
+SRC_URI="
+ https://sourceware.org/ftp/debugedit/${PV}/${P}.tar.xz
+ https://sourceware.org/ftp/debugedit/${PV}/${P}.tar.xz.sig
+"
+
+LICENSE="GPL-2+ LGPL-2+"
+SLOT="0"
+KEYWORDS="~amd64 ~arm ~arm64 ~hppa ~ia64 ~ppc ~ppc64 ~sparc ~x86 ~amd64-linux ~x86-linux"
+IUSE=""
+
+RDEPEND="
+ >=dev-libs/elfutils-0.176-r1
+"
+DEPEND=${RDEPEND}
+BDEPEND="
+ sys-apps/help2man
+ virtual/pkgconfig
+ verify-sig? (
+ app-crypt/openpgp-keys-debugedit
+ )
+"
+
+VERIFY_SIG_OPENPGP_KEY_PATH=${BROOT}/usr/share/openpgp-keys/debugedit.gpg
+
+PATCHES=(
+ "${FILESDIR}"/${P}-readelf.patch
+ "${FILESDIR}"/${P}-zero-dir-entry.patch
+)
+
+src_prepare() {
+ default
+ eautoreconf
+}
diff --git a/dev-util/debugedit/files/debugedit-5.0-readelf.patch b/dev-util/debugedit/files/debugedit-5.0-readelf.patch
new file mode 100644
index 000000000000..547b68710324
--- /dev/null
+++ b/dev-util/debugedit/files/debugedit-5.0-readelf.patch
@@ -0,0 +1,330 @@
+From 56e41d7c716a3657bdcce05146f7509d8a4e4a74 Mon Sep 17 00:00:00 2001
+From: Sergei Trofimovich <slyfox@gentoo.org>
+Date: Sun, 1 Aug 2021 21:15:35 +0100
+Subject: [PATCH] use $READELF, not readelf
+
+Allow user to specify own readelf. Use detected readelf,
+not 'readelf'.
+
+Noticed as a set of test failures on system with only
+$host-prefixed tools:
+
+ debugedit/tests/testsuite.dir/at-groups/4/test-source:
+ line 40: readelf: command not found
+
+ * configure.ac: Add READELF user override.
+ * scripts/find-debuginfo.in: Use @READELF@ instead of 'readelf'.
+ * tests/atlocal.in: Populate READELF variable detected by configure.
+ * tests/debugedit.at: Use $READELF instad of 'readelf' in tests.
+ * Makefile.am (do_subst): Add READELF substitution.
+
+Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org>
+---
+ Makefile.am | 3 ++-
+ configure.ac | 1 +
+ scripts/find-debuginfo.in | 2 +-
+ tests/atlocal.in | 1 +
+ tests/debugedit.at | 54 +++++++++++++++++++--------------------
+ 5 files changed, 32 insertions(+), 29 deletions(-)
+
+diff --git a/Makefile.am b/Makefile.am
+index 98b2f20..2060b96 100644
+--- a/Makefile.am
++++ b/Makefile.am
+@@ -32,7 +32,8 @@ CLEANFILES = $(bin_SCRIPTS)
+
+ # Some standard substitutions for scripts
+ do_subst = ($(SED) -e 's,[@]PACKAGE[@],$(PACKAGE),g' \
+- -e 's,[@]VERSION[@],$(VERSION),g')
++ -e 's,[@]VERSION[@],$(VERSION),g' \
++ -e 's,[@]READELF[@],$(READELF),g')
+
+ find-debuginfo: $(top_srcdir)/scripts/find-debuginfo.in Makefile
+ $(do_subst) < "$(top_srcdir)/scripts/$@.in" > "$@"
+diff --git a/configure.ac b/configure.ac
+index 85f2c4f..e5c9230 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -44,6 +44,7 @@ AC_PROG_SED
+ AC_PROG_CC_C99
+ AC_PROG_LN_S
+ AC_CHECK_TOOL([LD], [ld])
++AC_CHECK_TOOL([READELF], [readelf])
+ AM_MISSING_PROG(HELP2MAN, help2man)
+
+ # Only really an issue on 32bit platforms. Makes sure we'll get large off_t.
+diff --git a/scripts/find-debuginfo.in b/scripts/find-debuginfo.in
+index 8b9ce77..9c0a735 100755
+--- a/scripts/find-debuginfo.in
++++ b/scripts/find-debuginfo.in
+@@ -338,7 +338,7 @@ add_minidebug()
+ # symbol and NOBITS sections so cannot use --keep-only because that is
+ # too aggressive. Field $2 is the section name, $3 is the section type
+ # and $8 are the section flags.
+- local remove_sections=`readelf -W -S "$debuginfo" \
++ local remove_sections=`@READELF@ -W -S "$debuginfo" \
+ | awk '{ if (index($2,".debug_") != 1 \
+ && ($3 == "PROGBITS" || $3 == "NOTE" || $3 == "NOBITS") \
+ && index($8,"A") == 0) \
+diff --git a/tests/atlocal.in b/tests/atlocal.in
+index 0eec351..8399f8d 100644
+--- a/tests/atlocal.in
++++ b/tests/atlocal.in
+@@ -9,6 +9,7 @@ CC="@CC@"
+ CFLAGS=""
+ LD="@LD@"
+ LDFLAGS=""
++READELF="@READELF@"
+
+ GDWARF_5_FLAG=@GDWARF_5_FLAG@
+ GZ_NONE_FLAG=@GZ_NONE_FLAG@
+diff --git a/tests/debugedit.at b/tests/debugedit.at
+index 608b1d0..0311d26 100644
+--- a/tests/debugedit.at
++++ b/tests/debugedit.at
+@@ -93,7 +93,7 @@ DEBUGEDIT_SETUP([-gdwarf-4])
+
+ # Capture strings that start with the testdir (pwd) directory path
+ # (and replace that textually with /foo/bar/baz)
+-readelf -p.debug_str foo.o subdir_bar/bar.o baz.o | cut -c13- \
++$READELF -p.debug_str foo.o subdir_bar/bar.o baz.o | cut -c13- \
+ | grep ^$(pwd) | sort \
+ | sed -e "s@$(pwd)@/foo/bar/baz@" > expout
+
+@@ -108,7 +108,7 @@ AT_CHECK([[debugedit -b $(pwd) -d /foo/bar/baz ./foo.o]])
+ AT_CHECK([[debugedit -b $(pwd) -d /foo/bar/baz ./subdir_bar/bar.o]])
+ AT_CHECK([[debugedit -b $(pwd) -d /foo/bar/baz ./baz.o]])
+ AT_CHECK([[
+-readelf -p.debug_str foo.o subdir_bar/bar.o baz.o | cut -c13- \
++$READELF -p.debug_str foo.o subdir_bar/bar.o baz.o | cut -c13- \
+ | grep ^/foo/bar/baz | sort
+ ]],[0],[expout])
+
+@@ -125,7 +125,7 @@ DEBUGEDIT_SETUP([-gdwarf-5])
+
+ # Capture strings that start with the testdir (pwd) directory path
+ # (and replace that textually with /foo/bar/baz)
+-readelf -p.debug_str -p.debug_line_str foo.o subdir_bar/bar.o baz.o \
++$READELF -p.debug_str -p.debug_line_str foo.o subdir_bar/bar.o baz.o \
+ | cut -c13- \
+ | grep ^$(pwd) | sort | uniq \
+ | sed -e "s@$(pwd)@/foo/bar/baz@" > expout
+@@ -141,7 +141,7 @@ AT_CHECK([[debugedit -b $(pwd) -d /foo/bar/baz ./foo.o]])
+ AT_CHECK([[debugedit -b $(pwd) -d /foo/bar/baz ./subdir_bar/bar.o]])
+ AT_CHECK([[debugedit -b $(pwd) -d /foo/bar/baz ./baz.o]])
+ AT_CHECK([[
+-readelf -p.debug_str -p.debug_line_str foo.o subdir_bar/bar.o baz.o \
++$READELF -p.debug_str -p.debug_line_str foo.o subdir_bar/bar.o baz.o \
+ | cut -c13- \
+ | grep ^/foo/bar/baz | sort | uniq
+ ]],[0],[expout],[ignore])
+@@ -160,7 +160,7 @@ DEBUGEDIT_SETUP([-gdwarf-4])
+ # (and replace that textually with /foo/bar/baz)
+ # Note that partially linked files, might have multiple duplicate
+ # strings, but debugedit will merge them. So use sort -u.
+-readelf -p.debug_str ./foobarbaz.part.o | cut -c13- \
++$READELF -p.debug_str ./foobarbaz.part.o | cut -c13- \
+ | grep ^$(pwd) | sort -u \
+ | sed -e "s@$(pwd)@/foo/bar/baz@" > expout
+
+@@ -173,7 +173,7 @@ fi
+ # Check the replaced strings are all there.
+ AT_CHECK([[debugedit -b $(pwd) -d /foo/bar/baz ./foobarbaz.part.o]])
+ AT_CHECK([[
+-readelf -p.debug_str ./foobarbaz.part.o | cut -c13- \
++$READELF -p.debug_str ./foobarbaz.part.o | cut -c13- \
+ | grep ^/foo/bar/baz | sort
+ ]],[0],[expout])
+
+@@ -192,7 +192,7 @@ DEBUGEDIT_SETUP([-gdwarf-5])
+ # (and replace that textually with /foo/bar/baz)
+ # Note that partially linked files, might have multiple duplicate
+ # strings, but debugedit will merge them. So use sort -u.
+-readelf -p.debug_str -p.debug_line_str ./foobarbaz.part.o | cut -c13- \
++$READELF -p.debug_str -p.debug_line_str ./foobarbaz.part.o | cut -c13- \
+ | grep ^$(pwd) | sort -u | uniq \
+ | sed -e "s@$(pwd)@/foo/bar/baz@" > expout
+
+@@ -205,7 +205,7 @@ fi
+ # Check the replaced strings are all there.
+ AT_CHECK([[debugedit -b $(pwd) -d /foo/bar/baz ./foobarbaz.part.o]])
+ AT_CHECK([[
+-readelf -p.debug_str -p.debug_line_str ./foobarbaz.part.o | cut -c13- \
++$READELF -p.debug_str -p.debug_line_str ./foobarbaz.part.o | cut -c13- \
+ | grep ^/foo/bar/baz | sort | uniq
+ ]],[0],[expout],[ignore])
+
+@@ -221,7 +221,7 @@ DEBUGEDIT_SETUP([-gdwarf-4])
+
+ # Capture strings that start with the testdir (pwd) directory path
+ # (and replace that textually with /foo/bar/baz)
+-readelf -p.debug_str foobarbaz.exe | cut -c13- \
++$READELF -p.debug_str foobarbaz.exe | cut -c13- \
+ | grep ^$(pwd) | sort \
+ | sed -e "s@$(pwd)@/foo/bar/baz@" > expout
+
+@@ -235,7 +235,7 @@ fi
+ # Check the replaced strings are all there.
+ AT_CHECK([[debugedit -b $(pwd) -d /foo/bar/baz ./foobarbaz.exe]])
+ AT_CHECK([[
+-readelf -p.debug_str foobarbaz.exe | cut -c13- \
++$READELF -p.debug_str foobarbaz.exe | cut -c13- \
+ | grep ^/foo/bar/baz | sort
+ ]],[0],[expout])
+
+@@ -252,7 +252,7 @@ DEBUGEDIT_SETUP([-gdwarf-5])
+
+ # Capture strings that start with the testdir (pwd) directory path
+ # (and replace that textually with /foo/bar/baz)
+-readelf -p.debug_str -p.debug_line_str foobarbaz.exe | cut -c13- \
++$READELF -p.debug_str -p.debug_line_str foobarbaz.exe | cut -c13- \
+ | grep ^$(pwd) | sort | uniq \
+ | sed -e "s@$(pwd)@/foo/bar/baz@" > expout
+
+@@ -266,7 +266,7 @@ fi
+ # Check the replaced strings are all there.
+ AT_CHECK([[debugedit -b $(pwd) -d /foo/bar/baz ./foobarbaz.exe]])
+ AT_CHECK([[
+-readelf -p.debug_str -p.debug_line_str foobarbaz.exe | cut -c13- \
++$READELF -p.debug_str -p.debug_line_str foobarbaz.exe | cut -c13- \
+ | grep ^/foo/bar/baz | sort | uniq
+ ]],[0],[expout],[ignore])
+
+@@ -305,7 +305,7 @@ AT_CHECK([[debugedit -b $(pwd) -d /foo/bar/baz ./foo.o]])
+ AT_CHECK([[debugedit -b $(pwd) -d /foo/bar/baz ./subdir_bar/bar.o]])
+ AT_CHECK([[debugedit -b $(pwd) -d /foo/bar/baz ./baz.o]])
+ AT_CHECK([[
+-readelf --debug-dump=info foo.o subdir_bar/bar.o baz.o \
++$READELF --debug-dump=info foo.o subdir_bar/bar.o baz.o \
+ | grep -E 'DW_AT_(name|comp_dir)' \
+ | rev | cut -d: -f1 | rev | cut -c2- | grep ^/foo/bar/baz | sort -u
+ ]],[0],[expout])
+@@ -328,7 +328,7 @@ AT_DATA([expout],
+
+ AT_CHECK([[debugedit -b $(pwd) -d /foo/bar/baz ./foobarbaz.part.o]])
+ AT_CHECK([[
+-readelf --debug-dump=info ./foobarbaz.part.o \
++$READELF --debug-dump=info ./foobarbaz.part.o \
+ | grep -E 'DW_AT_(name|comp_dir)' \
+ | rev | cut -d: -f1 | rev | cut -c2- | grep ^/foo/bar/baz | sort -u
+ ]],[0],[expout])
+@@ -351,7 +351,7 @@ AT_DATA([expout],
+
+ AT_CHECK([[debugedit -b $(pwd) -d /foo/bar/baz ./foobarbaz.exe]])
+ AT_CHECK([[
+-readelf --debug-dump=info ./foobarbaz.exe | grep -E 'DW_AT_(name|comp_dir)' \
++$READELF --debug-dump=info ./foobarbaz.exe | grep -E 'DW_AT_(name|comp_dir)' \
+ | rev | cut -d: -f1 | rev | cut -c2- | grep ^/foo/bar/baz | sort -u
+ ]],[0],[expout])
+
+@@ -385,7 +385,7 @@ AT_CHECK([[debugedit -b $(pwd) -d /foo/bar/baz ./subdir_bar/bar.o]])
+ AT_CHECK([[debugedit -b $(pwd) -d /foo/bar/baz ./baz.o]])
+ AT_CHECK([[
+ for i in ./foo.o ./subdir_bar/bar.o ./baz.o;do \
+- readelf --debug-dump=info $i \
++ $READELF --debug-dump=info $i \
+ | awk '/Abbrev Number:.*DW_TAG_type_unit/{p=1}{if(p)print}/^$/{p=0}' \
+ | sed -n 's/^.*> *DW_AT_name *:.* \(stringp[^ ]*\|st.\)$/\1/p' \
+ | sort;
+@@ -415,7 +415,7 @@ stz
+
+ AT_CHECK([[debugedit -b $(pwd) -d /foo/bar/baz ./foobarbaz.part.o]])
+ AT_CHECK([[
+-readelf --debug-dump=info ./foobarbaz.part.o \
++$READELF --debug-dump=info ./foobarbaz.part.o \
+ | awk '/Abbrev Number:.*DW_TAG_type_unit/{p=1}{if(p)print}/^$/{p=0}' \
+ | sed -n 's/^.*> *DW_AT_name *:.* \(stringp[^ ]*\|st.\)$/\1/p' \
+ | sort
+@@ -444,7 +444,7 @@ stz
+
+ AT_CHECK([[debugedit -b $(pwd) -d /foo/bar/baz ./foobarbaz.exe]])
+ AT_CHECK([[
+-readelf --debug-dump=info ./foobarbaz.exe \
++$READELF --debug-dump=info ./foobarbaz.exe \
+ | awk '/Abbrev Number:.*DW_TAG_type_unit/{p=1}{if(p)print}/^$/{p=0}' \
+ | sed -n 's/^.*> *DW_AT_name *:.* \(stringp[^ ]*\|st.\)$/\1/p' \
+ | sort
+@@ -474,7 +474,7 @@ AT_CHECK([[debugedit -b $(pwd) -d /foo/bar/baz ./foo.o]])
+ AT_CHECK([[debugedit -b $(pwd) -d /foo/bar/baz ./subdir_bar/bar.o]])
+ AT_CHECK([[debugedit -b $(pwd) -d /foo/bar/baz ./baz.o]])
+ AT_CHECK([[
+-readelf --debug-dump=line foo.o subdir_bar/bar.o baz.o \
++$READELF --debug-dump=line foo.o subdir_bar/bar.o baz.o \
+ | grep -A3 "The Directory Table" | grep "^ [123]" \
+ | grep /foo/ | cut -c5- | sort
+ ]],[0],[expout])
+@@ -499,7 +499,7 @@ AT_CHECK([[debugedit -b $(pwd) -d /foo/bar/baz ./foo.o]])
+ AT_CHECK([[debugedit -b $(pwd) -d /foo/bar/baz ./subdir_bar/bar.o]])
+ AT_CHECK([[debugedit -b $(pwd) -d /foo/bar/baz ./baz.o]])
+ AT_CHECK([[
+-readelf --debug-dump=line foo.o subdir_bar/bar.o baz.o \
++$READELF --debug-dump=line foo.o subdir_bar/bar.o baz.o \
+ | grep -A5 "The Directory Table" | grep "^ [123]" \
+ | cut -f2- -d/ | grep ^foo/ | sort
+ ]],[0],[expout])
+@@ -521,7 +521,7 @@ AT_DATA([expout],
+
+ AT_CHECK([[debugedit -b $(pwd) -d /foo/bar/baz ./foobarbaz.part.o]])
+ AT_CHECK([[
+-readelf --debug-dump=line ./foobarbaz.part.o \
++$READELF --debug-dump=line ./foobarbaz.part.o \
+ | grep -A3 "The Directory Table" | grep "^ [123]" \
+ | grep /foo/ | cut -c5- | sort
+ ]],[0],[expout])
+@@ -544,7 +544,7 @@ foo/bar/baz/subdir_headers
+
+ AT_CHECK([[debugedit -b $(pwd) -d /foo/bar/baz ./foobarbaz.part.o]])
+ AT_CHECK([[
+-readelf --debug-dump=line ./foobarbaz.part.o \
++$READELF --debug-dump=line ./foobarbaz.part.o \
+ | grep -A5 "The Directory Table" | grep "^ [123]" \
+ | cut -f2- -d/ | grep ^foo/ | sort
+ ]],[0],[expout])
+@@ -566,7 +566,7 @@ AT_DATA([expout],
+
+ AT_CHECK([[debugedit -b $(pwd) -d /foo/bar/baz ./foobarbaz.exe]])
+ AT_CHECK([[
+-readelf --debug-dump=line ./foobarbaz.exe \
++$READELF --debug-dump=line ./foobarbaz.exe \
+ | grep -A3 "The Directory Table" | grep "^ [123]" \
+ | grep /foo/ | cut -c5- | sort
+ ]],[0],[expout])
+@@ -589,7 +589,7 @@ foo/bar/baz/subdir_headers
+
+ AT_CHECK([[debugedit -b $(pwd) -d /foo/bar/baz ./foobarbaz.exe]])
+ AT_CHECK([[
+-readelf --debug-dump=line ./foobarbaz.exe \
++$READELF --debug-dump=line ./foobarbaz.exe \
+ | grep -A5 "The Directory Table" | grep "^ [123]" \
+ | cut -f2- -d/ | grep ^foo/ | sort
+ ]],[0],[expout])
+@@ -615,7 +615,7 @@ AT_CHECK([[debugedit -b $(pwd) -d /foo/bar/baz ./foo.o]])
+ AT_CHECK([[debugedit -b $(pwd) -d /foo/bar/baz ./subdir_bar/bar.o]])
+ AT_CHECK([[debugedit -b $(pwd) -d /foo/bar/baz ./baz.o]])
+ AT_CHECK([[
+-readelf --debug-dump=macro foo.o subdir_bar/bar.o baz.o \
++$READELF --debug-dump=macro foo.o subdir_bar/bar.o baz.o \
+ | grep NUMBER | rev | cut -d: -f1 | rev | cut -c2-
+ ]],[0],[expout])
+
+@@ -638,7 +638,7 @@ NUMBER 42
+
+ AT_CHECK([[debugedit -b $(pwd) -d /foo/bar/baz ./foobarbaz.part.o]])
+ AT_CHECK([[
+-readelf --debug-dump=macro ./foobarbaz.part.o \
++$READELF --debug-dump=macro ./foobarbaz.part.o \
+ | grep NUMBER | rev | cut -d: -f1 | rev | cut -c2-
+ ]],[0],[expout])
+
+@@ -661,7 +661,7 @@ NUMBER 42
+
+ AT_CHECK([[debugedit -b $(pwd) -d /foo/bar/baz ./foobarbaz.exe]])
+ AT_CHECK([[
+-readelf --debug-dump=macro ./foobarbaz.exe \
++$READELF --debug-dump=macro ./foobarbaz.exe \
+ | grep NUMBER | rev | cut -d: -f1 | rev | cut -c2-
+ ]],[0],[expout])
+
+--
+2.27.0
+
diff --git a/dev-util/debugedit/files/debugedit-5.0-zero-dir-entry.patch b/dev-util/debugedit/files/debugedit-5.0-zero-dir-entry.patch
new file mode 100644
index 000000000000..f564b0b99e84
--- /dev/null
+++ b/dev-util/debugedit/files/debugedit-5.0-zero-dir-entry.patch
@@ -0,0 +1,130 @@
+From ae27211cbbfb63a0ad3c141cd1310d7f583ec40e Mon Sep 17 00:00:00 2001
+From: Mark Wielaard <mark@klomp.org>
+Date: Fri, 30 Jul 2021 18:09:46 +0200
+Subject: [PATCH] tests: Handle zero directory entry in .debug_line DWARF5
+ debugedit.at
+
+We were skipping the zero directory entry, because it was always
+the same as the directory entry at position one. But that isn't
+true anymore with gcc 11.2.1. There the zero dir entry is unique.
+Fix the debugedit.at .debug_line testcases using DWARF5 to also
+include dir entry zero.
+
+Signed-off-by: Mark Wielaard <mark@klomp.org>
+---
+ configure.ac | 14 ++++++++++++++
+ tests/atlocal.in | 1 +
+ tests/debugedit.at | 18 ++++++++++++------
+ 3 files changed, 27 insertions(+), 6 deletions(-)
+
+diff --git a/configure.ac b/configure.ac
+index e5c9230..6a53365 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -87,6 +87,20 @@ CFLAGS="$save_CFLAGS"
+ GDWARF_5_FLAG=$ac_cv_gdwarf_5
+ AC_SUBST([GDWARF_5_FLAG])
+
++AC_CACHE_CHECK([whether -gdwarf-5 produced DWARF5 .debug_line], ac_cv_dwarf_5_debugline, [dnl
++save_CFLAGS="$CFLAGS"
++CFLAGS="-gdwarf-5"
++AC_COMPILE_IFELSE([AC_LANG_SOURCE([[int i=0;]],[[/* empty main */]])],
++ [if $READELF --debug-dump=line conftest.o 2>&1 | \
++ grep "DWARF Version:" 2>&1 | grep "5" > /dev/null 2>&1; \
++ then ac_cv_dwarf_5_debugline=yes; \
++ else ac_cv_dwarf_5_debugline=no; fi],
++ ac_cv_dwarf_5_debugline=no)
++CFLAGS="$save_CFLAGS"
++])
++DWARF_5_DEBUGLINE=$ac_cv_dwarf_5_debugline
++AC_SUBST([DWARF_5_DEBUGLINE])
++
+ AC_CACHE_CHECK([whether gcc supports -gz=none], ac_cv_gz_none, [dnl
+ save_CFLAGS="$CFLAGS"
+ CFLAGS="-gz=none"
+diff --git a/tests/atlocal.in b/tests/atlocal.in
+index 8399f8d..d916301 100644
+--- a/tests/atlocal.in
++++ b/tests/atlocal.in
+@@ -13,3 +13,4 @@ READELF="@READELF@"
+
+ GDWARF_5_FLAG=@GDWARF_5_FLAG@
+ GZ_NONE_FLAG=@GZ_NONE_FLAG@
++DWARF_5_DEBUGLINE=@DWARF_5_DEBUGLINE@
+diff --git a/tests/debugedit.at b/tests/debugedit.at
+index 0311d26..725e68e 100644
+--- a/tests/debugedit.at
++++ b/tests/debugedit.at
+@@ -488,10 +488,12 @@ AT_CLEANUP
+ AT_SETUP([debugedit .debug_line objects DWARF5])
+ AT_KEYWORDS([debuginfo] [debugedit])
+ AT_SKIP_IF([test "$GDWARF_5_FLAG" = "no"])
++AT_SKIP_IF([test "$DWARF_5_DEBUGLINE" = "no"])
+ DEBUGEDIT_SETUP([-gdwarf-5])
+
+ AT_DATA([expout],
+ [foo/bar/baz
++foo/bar/baz/subdir_bar
+ foo/bar/baz/subdir_headers
+ ])
+
+@@ -500,8 +502,8 @@ AT_CHECK([[debugedit -b $(pwd) -d /foo/bar/baz ./subdir_bar/bar.o]])
+ AT_CHECK([[debugedit -b $(pwd) -d /foo/bar/baz ./baz.o]])
+ AT_CHECK([[
+ $READELF --debug-dump=line foo.o subdir_bar/bar.o baz.o \
+- | grep -A5 "The Directory Table" | grep "^ [123]" \
+- | cut -f2- -d/ | grep ^foo/ | sort
++ | grep -A5 "The Directory Table" | grep "^ [0123]" \
++ | cut -f2- -d/ | grep ^foo/ | sort -u
+ ]],[0],[expout])
+
+ AT_CLEANUP
+@@ -535,18 +537,20 @@ AT_CLEANUP
+ AT_SETUP([debugedit .debug_line partial DWARF5])
+ AT_KEYWORDS([debuginfo] [debugedit])
+ AT_SKIP_IF([test "$GDWARF_5_FLAG" = "no"])
++AT_SKIP_IF([test "$DWARF_5_DEBUGLINE" = "no"])
+ DEBUGEDIT_SETUP([-gdwarf-5])
+
+ AT_DATA([expout],
+ [foo/bar/baz
++foo/bar/baz/subdir_bar
+ foo/bar/baz/subdir_headers
+ ])
+
+ AT_CHECK([[debugedit -b $(pwd) -d /foo/bar/baz ./foobarbaz.part.o]])
+ AT_CHECK([[
+ $READELF --debug-dump=line ./foobarbaz.part.o \
+- | grep -A5 "The Directory Table" | grep "^ [123]" \
+- | cut -f2- -d/ | grep ^foo/ | sort
++ | grep -A5 "The Directory Table" | grep "^ [0123]" \
++ | cut -f2- -d/ | grep ^foo/ | sort -u
+ ]],[0],[expout])
+
+ AT_CLEANUP
+@@ -580,18 +584,20 @@ AT_CLEANUP
+ AT_SETUP([debugedit .debug_line exe DWARF5])
+ AT_KEYWORDS([debuginfo] [debugedit])
+ AT_SKIP_IF([test "$GDWARF_5_FLAG" = "no"])
++AT_SKIP_IF([test "$DWARF_5_DEBUGLINE" = "no"])
+ DEBUGEDIT_SETUP([-gdwarf-5])
+
+ AT_DATA([expout],
+ [foo/bar/baz
++foo/bar/baz/subdir_bar
+ foo/bar/baz/subdir_headers
+ ])
+
+ AT_CHECK([[debugedit -b $(pwd) -d /foo/bar/baz ./foobarbaz.exe]])
+ AT_CHECK([[
+ $READELF --debug-dump=line ./foobarbaz.exe \
+- | grep -A5 "The Directory Table" | grep "^ [123]" \
+- | cut -f2- -d/ | grep ^foo/ | sort
++ | grep -A5 "The Directory Table" | grep "^ [0123]" \
++ | cut -f2- -d/ | grep ^foo/ | sort -u
+ ]],[0],[expout])
+
+ AT_CLEANUP
+--
+2.27.0
+