From mboxrd@z Thu Jan  1 00:00:00 1970
From: Stefan Schantl <stefan.schantl@ipfire.org>
To: development@lists.ipfire.org
Subject:
 [PATCH] Add option to keep or remove sections when extracting debuginfo.
Date: Mon, 02 Sep 2019 14:13:11 +0200
Message-ID: <20190902121311.14373-1-stefan.schantl@ipfire.org>
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="===============1096373269176081955=="
List-Id: <development.lists.ipfire.org>

--===============1096373269176081955==
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: quoted-printable

Signed-off-by: Stefan Schantl <stefan.schantl(a)ipfire.org>
---
 src/scripts/extract-debuginfo.in | 14 +++++++++++++-
 1 file changed, 13 insertions(+), 1 deletion(-)

diff --git a/src/scripts/extract-debuginfo.in b/src/scripts/extract-debuginfo=
.in
index c258ed1..c43cae4 100644
--- a/src/scripts/extract-debuginfo.in
+++ b/src/scripts/extract-debuginfo.in
@@ -2,6 +2,7 @@
 # extract-debuginfo.sh - automagically generate debug info
 #
 # Usage: extract-debuginfo.sh [--strict-build-id] [-g] [-r]
+#			      [--keep-section SECTION] [--remove-section SECTION]
 #			      [builddir]
 #
 # The -g flag says to use strip -g instead of full strip on DSOs.
@@ -25,6 +26,9 @@ strip_r=3Dfalse
 # Barf on missing build IDs.
 strict=3Dfalse
=20
+# keep or remove arguments to eu-strip.
+keep_remove_args=3D
+
 BUILDDIR=3D.
 while [ $# -gt 0 ]; do
 	case "${1}" in
@@ -43,6 +47,14 @@ while [ $# -gt 0 ]; do
 		-r)
 			strip_r=3Dtrue
 			;;
+		--keep-section)
+			keep_remove_args=3D"${keep_remove_args} --keep-section $2"
+			shift
+			;;
+		--remove-section)
+			keep_remove_args=3D"${keep_remove_args} --remove-section $2"
+			shift
+			;;
 		*)
 			BUILDDIR=3D${1}
 			shift
@@ -68,7 +80,7 @@ strip_to_debug() {
 				;;
 		esac
=20
-	eu-strip --remove-comment ${r} ${g} -f "${1}" "${2}" || exit
+	eu-strip --remove-comment ${r} ${g} ${keep_remove_args} -f "${1}" "${2}" ||=
 exit
 	chmod 444 "${1}" || exit
 }
=20
--=20
2.20.1


--===============1096373269176081955==--