Skip to content

Instantly share code, notes, and snippets.

@AaronDMarasco-VSI
Created May 9, 2017 10:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save AaronDMarasco-VSI/cacfade609b77d8627567eaf3202d30e to your computer and use it in GitHub Desktop.
Save AaronDMarasco-VSI/cacfade609b77d8627567eaf3202d30e to your computer and use it in GitHub Desktop.
--- src/patchelf.cc.orig 2015-09-23 14:32:37.245849869 -0400
+++ src/patchelf.cc 2015-09-23 14:49:41.719109921 -0400
@@ -970,6 +970,25 @@
return;
}
+ if (soname)
+ debug("current SONAME is '%s'\n", soname);
+
+ if (soname and newSoname == "OCPI") {
+ char *old = strstr(soname, "_s.so");
+ if (old) {
+ do {
+ *old = *(old + 2);
+ } while (*old++);
+ *old = '\0'; // One more NULL (there should now be three at the end: original, copied, and this one stuffed in between)
+ // memcpy(old, ".so\0\0", 5);
+ debug("new SONAME is `%s'\n", soname);
+ changed = true;
+ return;
+ } else {
+ error("Could not find '_s.so' in SONAME!");
+ }
+ }
+
/* Zero out the previous SONAME */
unsigned int sonameSize = 0;
if (soname) {
@@ -1545,6 +1564,10 @@
setSoname = true;
newSoname = argv[i];
}
+ else if (arg == "--ocpi-fix-soname") {
+ setSoname = true;
+ newSoname = "OCPI";
+ }
else if (arg == "--remove-rpath") {
removeRPath = true;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment