Thank you very much for your responses. I am reassured that there is no bug and that my patch just provides a convenient workaround for my use case. Albeit by accident rather than design!
I am attempting to load binary executables and shared libraries from the sdcard on Android. My patch does allow me to execute the busybox binary from sdcard if I load them using my patched musl. I have not yet tried loading any shared libraries from the sdcard.
An alternative I am experimenting with at the moment is using LLVM and storing the bitcode on the sdcard and running it under lli.
Your responses are very informative so I might have another look at patching musl to see if shared libraries can be loaded from sdcard also. The dlopen function will probably need to be reworked to use open rather than mmap but I need to learn some more first!
Many thanks,
Andrew