Skip to content

Commit c66b2de

Browse files
committed
` -> '
1 parent 0ed7193 commit c66b2de

File tree

1 file changed

+32
-32
lines changed

1 file changed

+32
-32
lines changed

src/patchelf.cc

Lines changed: 32 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,7 @@ class ElfFile
174174
void addNeeded(set<string> libs);
175175

176176
void removeNeeded(set<string> libs);
177-
177+
178178
void replaceNeeded(map<string, string>& libs);
179179

180180
void printNeededLibs();
@@ -409,7 +409,7 @@ static unsigned int roundUp(unsigned int n, unsigned int m)
409409
template<ElfFileParams>
410410
void ElfFile<ElfFileParamNames>::shiftFile(unsigned int extraPages, Elf_Addr startPage)
411411
{
412-
/* Move the entire contents of the file `extraPages' pages
412+
/* Move the entire contents of the file 'extraPages' pages
413413
further. */
414414
unsigned int oldSize = fileSize;
415415
unsigned int shift = extraPages * getPageSize();
@@ -525,7 +525,7 @@ void ElfFile<ElfFileParamNames>::writeReplacedSections(Elf_Off & curOff,
525525
{
526526
string sectionName = i->first;
527527
Elf_Shdr & shdr = findSection(sectionName);
528-
debug("rewriting section `%s' from offset 0x%x (size %d) to offset 0x%x (size %d)\n",
528+
debug("rewriting section '%s' from offset 0x%x (size %d) to offset 0x%x (size %d)\n",
529529
sectionName.c_str(), rdi(shdr.sh_offset), rdi(shdr.sh_size), curOff, i->second.size());
530530

531531
memcpy(contents + curOff, (unsigned char *) i->second.c_str(),
@@ -614,7 +614,7 @@ void ElfFile<ElfFileParamNames>::rewriteSectionsLibrary()
614614
} else {
615615
size_t hole = startPage - startOffset;
616616
/* Print a warning, because the hole could be very big. */
617-
fprintf(stderr, "warning: working around a Linux kernel bug by creating a hole of %zu bytes in ‘%s’\n", hole, fileName.c_str());
617+
fprintf(stderr, "warning: working around a Linux kernel bug by creating a hole of %zu bytes in '%s'\n", hole, fileName.c_str());
618618
assert(hole % getPageSize() == 0);
619619
/* !!! We could create an actual hole in the file here,
620620
but it's probably not worth the effort. */
@@ -664,7 +664,7 @@ void ElfFile<ElfFileParamNames>::rewriteSectionsExecutable()
664664
for (unsigned int i = 1; i < rdi(hdr->e_shnum); ++i) {
665665
string sectionName = getSectionName(shdrs[i]);
666666
if (replacedSections.find(sectionName) != replacedSections.end()) {
667-
debug("using replaced section `%s'\n", sectionName.c_str());
667+
debug("using replaced section '%s'\n", sectionName.c_str());
668668
lastReplaced = i;
669669
}
670670
}
@@ -684,7 +684,7 @@ void ElfFile<ElfFileParamNames>::rewriteSectionsExecutable()
684684
for (unsigned int i = 1; i <= lastReplaced; ++i) {
685685
Elf_Shdr & shdr(shdrs[i]);
686686
string sectionName = getSectionName(shdr);
687-
debug("looking at section `%s'\n", sectionName.c_str());
687+
debug("looking at section '%s'\n", sectionName.c_str());
688688
/* !!! Why do we stop after a .dynstr section? I can't
689689
remember! */
690690
if ((rdi(shdr.sh_type) == SHT_PROGBITS && sectionName != ".interp")
@@ -696,7 +696,7 @@ void ElfFile<ElfFileParamNames>::rewriteSectionsExecutable()
696696
break;
697697
} else {
698698
if (replacedSections.find(sectionName) == replacedSections.end()) {
699-
debug("replacing section `%s' which is in the way\n", sectionName.c_str());
699+
debug("replacing section '%s' which is in the way\n", sectionName.c_str());
700700
replaceSection(sectionName, rdi(shdr.sh_size));
701701
}
702702
}
@@ -780,7 +780,7 @@ void ElfFile<ElfFileParamNames>::rewriteSections()
780780

781781
for (ReplacedSections::iterator i = replacedSections.begin();
782782
i != replacedSections.end(); ++i)
783-
debug("replacing section `%s' with size %d\n",
783+
debug("replacing section '%s' with size %d\n",
784784
i->first.c_str(), i->second.size());
785785

786786
if (rdi(hdr->e_type) == ET_DYN) {
@@ -977,7 +977,7 @@ void ElfFile<ElfFileParamNames>::modifySoname(sonameMode op, const string & newS
977977
memset(soname, 'X', sonameSize);
978978
}
979979

980-
debug("new SONAME is `%s'\n", newSoname.c_str());
980+
debug("new SONAME is '%s'\n", newSoname.c_str());
981981

982982
/* Grow the .dynstr section to make room for the new SONAME. */
983983
debug("SONAME is too long, resizing...\n");
@@ -1054,8 +1054,8 @@ void ElfFile<ElfFileParamNames>::modifyRPath(RPathOp op, string newRPath)
10541054
overriden by LD_LIBRARY_PATH, and it's scoped (the DT_RUNPATH
10551055
for an executable or library doesn't affect the search path for
10561056
libraries used by it). DT_RPATH is ignored if DT_RUNPATH is
1057-
present. The binutils `ld' still generates only DT_RPATH,
1058-
unless you use its `--enable-new-dtag' option, in which case it
1057+
present. The binutils 'ld' still generates only DT_RPATH,
1058+
unless you use its '--enable-new-dtag' option, in which case it
10591059
generates a DT_RPATH and DT_RUNPATH pointing at the same
10601060
string. */
10611061
static vector<string> neededLibs;
@@ -1126,7 +1126,7 @@ void ElfFile<ElfFileParamNames>::modifyRPath(RPathOp op, string newRPath)
11261126
}
11271127

11281128
if (!libFound)
1129-
debug("removing directory `%s' from RPATH\n", dirName.c_str());
1129+
debug("removing directory '%s' from RPATH\n", dirName.c_str());
11301130
else
11311131
concatToRPath(newRPath, dirName);
11321132
}
@@ -1168,7 +1168,7 @@ void ElfFile<ElfFileParamNames>::modifyRPath(RPathOp op, string newRPath)
11681168
memset(rpath, 'X', rpathSize);
11691169
}
11701170

1171-
debug("new rpath is `%s'\n", newRPath.c_str());
1171+
debug("new rpath is '%s'\n", newRPath.c_str());
11721172

11731173
if (!forceRPath && dynRPath && !dynRunPath) { /* convert DT_RPATH to DT_RUNPATH */
11741174
dynRPath->d_tag = DT_RUNPATH;
@@ -1236,10 +1236,10 @@ void ElfFile<ElfFileParamNames>::removeNeeded(set<string> libs)
12361236
if (rdi(dyn->d_tag) == DT_NEEDED) {
12371237
char * name = strTab + rdi(dyn->d_un.d_val);
12381238
if (libs.find(name) != libs.end()) {
1239-
debug("removing DT_NEEDED entry `%s'\n", name);
1239+
debug("removing DT_NEEDED entry '%s'\n", name);
12401240
changed = true;
12411241
} else {
1242-
debug("keeping DT_NEEDED entry `%s'\n", name);
1242+
debug("keeping DT_NEEDED entry '%s'\n", name);
12431243
*last++ = *dyn;
12441244
}
12451245
} else
@@ -1253,40 +1253,40 @@ template<ElfFileParams>
12531253
void ElfFile<ElfFileParamNames>::replaceNeeded(map<string, string>& libs)
12541254
{
12551255
if (libs.empty()) return;
1256-
1256+
12571257
Elf_Shdr & shdrDynamic = findSection(".dynamic");
12581258
Elf_Shdr & shdrDynStr = findSection(".dynstr");
12591259
char * strTab = (char *) contents + rdi(shdrDynStr.sh_offset);
12601260

12611261
Elf_Dyn * dyn = (Elf_Dyn *) (contents + rdi(shdrDynamic.sh_offset));
1262-
1262+
12631263
unsigned int verNeedNum = 0;
12641264

12651265
unsigned int dynStrAddedBytes = 0;
1266-
1266+
12671267
for ( ; rdi(dyn->d_tag) != DT_NULL; dyn++) {
12681268
if (rdi(dyn->d_tag) == DT_NEEDED) {
12691269
char * name = strTab + rdi(dyn->d_un.d_val);
12701270
if (libs.find(name) != libs.end()) {
12711271
const string & replacement = libs[name];
1272-
1273-
debug("replacing DT_NEEDED entry `%s' with `%s'\n", name, replacement.c_str());
1274-
1272+
1273+
debug("replacing DT_NEEDED entry '%s' with '%s'\n", name, replacement.c_str());
1274+
12751275
// technically, the string referred by d_val could be used otherwise, too (although unlikely)
12761276
// we'll therefore add a new string
12771277
debug("resizing .dynstr ...\n");
1278-
1278+
12791279
string & newDynStr = replaceSection(".dynstr",
12801280
rdi(shdrDynStr.sh_size) + replacement.size() + 1 + dynStrAddedBytes);
12811281
setSubstr(newDynStr, rdi(shdrDynStr.sh_size) + dynStrAddedBytes, replacement + '\0');
1282-
1282+
12831283
wri(dyn->d_un.d_val, rdi(shdrDynStr.sh_size) + dynStrAddedBytes);
1284-
1284+
12851285
dynStrAddedBytes += replacement.size() + 1;
1286-
1286+
12871287
changed = true;
12881288
} else {
1289-
debug("keeping DT_NEEDED entry `%s'\n", name);
1289+
debug("keeping DT_NEEDED entry '%s'\n", name);
12901290
}
12911291
}
12921292
if (rdi(dyn->d_tag) == DT_VERNEEDNUM) {
@@ -1321,7 +1321,7 @@ void ElfFile<ElfFileParamNames>::replaceNeeded(map<string, string>& libs)
13211321
if (libs.find(file) != libs.end()) {
13221322
const string & replacement = libs[file];
13231323

1324-
debug("replacing .gnu.version_r entry `%s' with `%s'\n", file, replacement.c_str());
1324+
debug("replacing .gnu.version_r entry '%s' with '%s'\n", file, replacement.c_str());
13251325
debug("resizing string section %s ...\n", versionRStringsSName.c_str());
13261326

13271327
string & newVerDynStr = replaceSection(versionRStringsSName,
@@ -1334,7 +1334,7 @@ void ElfFile<ElfFileParamNames>::replaceNeeded(map<string, string>& libs)
13341334

13351335
changed = true;
13361336
} else {
1337-
debug("keeping .gnu.version_r entry `%s'\n", file);
1337+
debug("keeping .gnu.version_r entry '%s'\n", file);
13381338
}
13391339
// the Elf_Verneed structures form a linked list, so jump to next entry
13401340
need = (Elf_Verneed *) (((char *) need) + rdi(need->vn_next));
@@ -1356,7 +1356,7 @@ void ElfFile<ElfFileParamNames>::addNeeded(set<string> libs)
13561356
for (set<string>::iterator it = libs.begin(); it != libs.end(); it++) {
13571357
length += it->size() + 1;
13581358
}
1359-
1359+
13601360
string & newDynStr = replaceSection(".dynstr",
13611361
rdi(shdrDynStr.sh_size) + length + 1);
13621362
set<Elf64_Xword> libStrings;
@@ -1366,7 +1366,7 @@ void ElfFile<ElfFileParamNames>::addNeeded(set<string> libs)
13661366
libStrings.insert(rdi(shdrDynStr.sh_size) + pos);
13671367
pos += it->size() + 1;
13681368
}
1369-
1369+
13701370
/* add all new needed entries to the dynamic section */
13711371
string & newDynamic = replaceSection(".dynamic",
13721372
rdi(shdrDynamic.sh_size) + sizeof(Elf_Dyn) * libs.size());
@@ -1387,7 +1387,7 @@ void ElfFile<ElfFileParamNames>::addNeeded(set<string> libs)
13871387
wri(newDyn.d_un.d_val, *it);
13881388
setSubstr(newDynamic, i * sizeof(Elf_Dyn), string((char *) &newDyn, sizeof(Elf_Dyn)));
13891389
}
1390-
1390+
13911391
changed = true;
13921392
}
13931393

@@ -1511,7 +1511,7 @@ static void patchElf2(ElfFile & elfFile)
15111511
static void patchElf()
15121512
{
15131513
if (!printInterpreter && !printRPath && !printSoname && !printNeeded)
1514-
debug("patching ELF file `%s'\n", fileName.c_str());
1514+
debug("patching ELF file '%s'\n", fileName.c_str());
15151515

15161516
debug("Kernel page size is %u bytes\n", getPageSize());
15171517

0 commit comments

Comments
 (0)