diff --git a/gdb/contrib/gdb-add-index.sh b/gdb/contrib/gdb-add-index.sh
--- a/gdb/contrib/gdb-add-index.sh
+++ b/gdb/contrib/gdb-add-index.sh
@@ -22,6 +22,20 @@ GDB=${GDB:=gdb}
 OBJCOPY=${OBJCOPY:=objcopy}
 READELF=${READELF:=readelf}
 
+GDB2=/usr/libexec/gdb
+if test -x $GDB2 && ! which $GDB &>/dev/null; then
+    GDB=$GDB2
+fi
+
+# We default to using /usr/bin/gdb.minimal if it's present.  See
+# https://bugzilla.redhat.com/show_bug.cgi?id=1695015 and
+# https://fedoraproject.org/wiki/Changes/Minimal_GDB_in_buildroot for
+# explanations.
+GDB3=/usr/bin/gdb.minimal
+if test -x $GDB3; then
+    GDB=$GDB3
+fi
+
 myname="${0##*/}"
 
 dwarf5=""
