This is the mail archive of the mailing list for the GDB project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[patch] contrib/ chmod u+w


in Fedora 24 it still worked, in Fedora 25 it does not - *-debuginfo.rpm
no longer have the .gdb_index accelerating section now.

It happens because:
objcopy: unable to copy file 'foo.debug'; reason: Permission denied

*.debug files in Fedora were always 444 but the time gdb-add-index is run is
still before the *.debug split and in Fedora 24 the files were -rwxr-xr-x
that time while in Fedora 25 they are apparently no longer w.

OK for check-in?

2017-01-06  Jan Kratochvil  <>

	* contrib/ Use chmod u+w for $file.

diff --git a/gdb/contrib/ b/gdb/contrib/
index 0cd4ce3..5a190a0 100755
--- a/gdb/contrib/
+++ b/gdb/contrib/
@@ -38,10 +38,11 @@ fi
 test "$dir" = "$file" && dir="."
-rm -f $index
+rm -f $index $mode
 # Ensure intermediate index file is removed when we exit.
-trap "rm -f $index" 0
+trap "rm -f $index $mode" 0
 $GDB --batch -nx -iex 'set auto-load no' \
     -ex "file $file" -ex "save gdb-index $dir" || {
@@ -58,8 +59,13 @@ $GDB --batch -nx -iex 'set auto-load no' \
 if test -f "$index"; then
+    touch "$mode"
+    chmod --reference="$file" "$mode"
+    # objcopy: unable to copy file 'foo.debug'; reason: Permission denied
+    chmod u+w "$file"
     $OBJCOPY --add-section .gdb_index="$index" \
 	--set-section-flags .gdb_index=readonly "$file" "$file"
+    chmod --reference="$mode" "$file"
     echo "$myname: No index was created for $file" 1>&2

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]