summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorEelco Dolstra <eelco.dolstra@logicblox.com>2016-02-22 19:08:22 (GMT)
committerEelco Dolstra <eelco.dolstra@logicblox.com>2016-02-22 19:08:22 (GMT)
commit501009735dd6fb2f094d4c37e141706abf5155de (patch)
tree6df1cb21a7db11d2d864c7106caa43bb7df3f846 /src
parent0fa104d5cea8a15db94e07c503f9cbd50483c26d (diff)
parent20ccc36b9cdb4119fe326724bfee70d1619e31ee (diff)
downloadpatchelf-501009735dd6fb2f094d4c37e141706abf5155de.zip
patchelf-501009735dd6fb2f094d4c37e141706abf5155de.tar.gz
patchelf-501009735dd6fb2f094d4c37e141706abf5155de.tar.bz2
Merge branch 'pagesize' of https://github.com/fsateler/patchelf
Diffstat (limited to 'src')
-rw-r--r--src/patchelf.cc16
1 files changed, 8 insertions, 8 deletions
diff --git a/src/patchelf.cc b/src/patchelf.cc
index a405174..82506b5 100644
--- a/src/patchelf.cc
+++ b/src/patchelf.cc
@@ -47,7 +47,7 @@ static bool debugMode = false;
static bool forceRPath = false;
static string fileName;
-
+static int pageSize = PAGESIZE;
off_t fileSize, maxSize;
unsigned char * contents = 0;
@@ -58,13 +58,7 @@ unsigned char * contents = 0;
static unsigned int getPageSize(){
-#ifdef MIPSEL
- /* The lemote fuloong 2f kernel defconfig sets a page size of
- 16KB. */
- return 4096 * 4;
-#else
- return 4096;
-#endif
+ return pageSize;
}
@@ -1496,6 +1490,7 @@ void showHelp(const string & progName)
{
fprintf(stderr, "syntax: %s\n\
[--set-interpreter FILENAME]\n\
+ [--page-size SIZE]\n\
[--print-interpreter]\n\
[--print-soname]\t\tPrints 'DT_SONAME' entry of .dynamic section. Raises an error if DT_SONAME doesn't exist\n\
[--set-soname SONAME]\t\tSets 'DT_SONAME' entry to SONAME.\n\
@@ -1531,6 +1526,11 @@ int main(int argc, char * * argv)
if (++i == argc) error("missing argument");
newInterpreter = argv[i];
}
+ else if (arg == "--page-size") {
+ if (++i == argc) error("missing argument");
+ pageSize = atoi(argv[i]);
+ if (pageSize <= 0) error("invalid argument to --page-size");
+ }
else if (arg == "--print-interpreter") {
printInterpreter = true;
}