Closed ttamttam closed 4 years ago
This is https://github.com/alainfrisch/flexdll/pull/3, I think?
This certainly should be fixed - the problem with all these linker things (I find) is finding concrete documentation (or at least a clear pointer into binutils, or whatever else is doing it this way!). Last time I had a go at this, I gave up trying to find any - do you have any pointers to docs?
(fundamentally, yes, the fix belongs here in flexdll!)
http://www.cygwin.com/ml/cygwin/2002-01/msg00236.html may be of (some) help.
The full gory details are also documented in binutils - https://sourceware.org/git/?p=binutils-gdb.git;a=blob;f=ld/pe-dll.c;h=0addde231863a50e7111e2ce23cd00699dcfb98c;hb=HEAD
Working with https://github.com/ocaml-cross/opam-cross-windows which relies on flexdll, I hit a strange problem: for some C++ DLL I'm calling from OCaml, some symbols where prefixed with "__nm_". I do not know why?
I solved this by patching
flexdll
(see https://github.com/ocaml-cross/opam-cross-windows/pull/108). I submitted this patch to https://github.com/ocaml-cross/opam-cross-windows, but if the solution to my problem is sane, it would be better to include it intoflexdll
.This patch modifies
aliases
function (https://github.com/alainfrisch/flexdll/blob/master/coff.ml#L757-L766) for it to store both the whole symbol and the symbol without the "__nm_" prefix in the alias hash-table:It works, but re-reading it, I think it should have been something like the following instead:
Anyway: after I would correct and test this, would such a PR be considered to be accepted in
flexdll
, or does it solve my problem the wrong way?