]> git.ipfire.org Git - ipfire-3.x.git/blame - binutils/patches/binutils-2.20-objcopy.patch
pakfire: Add platform patches.
[ipfire-3.x.git] / binutils / patches / binutils-2.20-objcopy.patch
CommitLineData
ec35ee06
SS
1diff --git a/binutils/objcopy.c b/binutils/objcopy.c
2index 9732b86..dec0feb 100644
3--- a/binutils/objcopy.c
4+++ b/binutils/objcopy.c
5@@ -2287,6 +2287,18 @@ copy_file (const char *input_filename, const char *output_filename,
6
7 status = 1;
8 }
9+
10+ if (status == 0)
11+ {
12+ struct stat statbuf;
13+
14+ /* No need to check the return value of stat(). It has already
15+ been checked in get_file_size(). */
16+ stat (input_filename, &statbuf);
17+
18+ /* Try to preserve the permission bits. */
19+ chmod (output_filename, statbuf.st_mode);
20+ }
21 }
22
23 /* Add a name to the section renaming list. */
24