diff --git a/pd/src/s_loader.c b/pd/src/s_loader.c
index fe1304c63155578b5f1be4f2ee34de2b454be482..84924cbf85d57cc1bf6b69e63b0a121d4ff98551 100644
--- a/pd/src/s_loader.c
+++ b/pd/src/s_loader.c
@@ -165,6 +165,25 @@ static int sys_do_load_lib(t_canvas *canvas, const char *objectname,
     if ((fd = sys_trytoopenone(path, filename, sys_dllextent2,
         dirbuf, &nameptr, MAXPDSTRING, 1)) >= 0)
             goto gotone;
+        /* for hexmunged binary external files, give it a shot
+           with the hexmunged name. This is a really ugly system
+           but we need it for all the legacy libraries that use
+           funky characters. (The only alternative is putting libdir
+           classes all in a single file and preloading, which is
+           even worse.
+           The hexmunger never worked for abstractions without recompiling,
+           so we don't and won't support hexmunged abstractions.
+        */
+    if (hexmunge)
+    {
+        if ((fd = sys_trytoopenone(path, symname+6, sys_dllextent,
+            dirbuf, &nameptr, MAXPDSTRING, 1)) >= 0)
+                goto gotone;
+            /* same, with the more generic sys_dllextent2 */
+        if ((fd = sys_trytoopenone(path, symname+6, sys_dllextent2,
+            dirbuf, &nameptr, MAXPDSTRING, 1)) >= 0)
+                goto gotone;
+    }
 #ifdef ANDROID
     /* Android libs have a 'lib' prefix, '.so' suffix and don't allow ~ */
     char libname[MAXPDSTRING] = "lib";