Revert "Option --assume-execute-permission"

This reverts commit 4484acf9d6.
This commit is contained in:
Markus F.X.J. Oberhumer
2020-01-08 05:38:19 +01:00
parent 643e48efd7
commit 849bdd87e1
3 changed files with 3 additions and 7 deletions
-4
View File
@@ -872,9 +872,6 @@ static int do_option(int optc, const char *arg)
case 677: case 677:
opt->o_unix.force_pie = true; opt->o_unix.force_pie = true;
break; break;
case 678:
opt->o_unix.assume_execute_permission = true;
break;
case '\0': case '\0':
return -1; return -1;
@@ -1027,7 +1024,6 @@ static const struct mfx_option longopts[] =
{"preserve-build-id", 0, 0, 675}, {"preserve-build-id", 0, 0, 675},
{"android-shlib", 0, 0, 676}, {"android-shlib", 0, 0, 676},
{"force-pie", 0, 0, 677}, {"force-pie", 0, 0, 677},
{"assume-execute-permission", 0, 0, 678},
// watcom/le // watcom/le
{"le", 0x10, 0, 620}, // produce LE output {"le", 0x10, 0, 620}, // produce LE output
// win32/pe // win32/pe
-1
View File
@@ -148,7 +148,6 @@ struct options_t {
bool preserve_build_id; // copy the build-id to the compressed binary bool preserve_build_id; // copy the build-id to the compressed binary
bool android_shlib; // keep some ElfXX_Shdr for dlopen() bool android_shlib; // keep some ElfXX_Shdr for dlopen()
bool force_pie; // choose DF_1_PIE instead of is_shlib bool force_pie; // choose DF_1_PIE instead of is_shlib
bool assume_execute_permission; // do not check .st_mode for S_IXUSR
} o_unix; } o_unix;
struct { struct {
bool le; bool le;
+3 -2
View File
@@ -68,10 +68,11 @@ bool PackUnix::canPack()
if (exetype == 0) if (exetype == 0)
return false; return false;
#if defined(__unix__) && !defined(__MSYS2__)
// must be executable by owner // must be executable by owner
if (!opt->o_unix.assume_execute_permission // benefits __MSYS2__ if ((fi->st.st_mode & S_IXUSR) == 0)
&& (fi->st.st_mode & S_IXUSR) == 0)
throwCantPack("file not executable; try 'chmod +x'"); throwCantPack("file not executable; try 'chmod +x'");
#endif
if (file_size < 4096) if (file_size < 4096)
throwCantPack("file is too small"); throwCantPack("file is too small");