[patch] compile: Fix MinGW build [Re: [mingw rfc] Add mkdtemp to gdb/gnulib/]

Jan Kratochvil jan.kratochvil@redhat.com
Wed Dec 17 19:37:00 GMT 2014


On Wed, 17 Dec 2014 20:31:18 +0100, Eli Zaretskii wrote:
> Why is dlopen "intrusive"?  ISTM that using the Windows equivalent of
> dlopen is exactly the right thing here.

First I do not want to advocate the mmap() + ld.so reimplementation too much
as I would implement it the dlopen() way (at least in the initial
implementation) myself.

But AFAIK (but I do not know much) MS-Windows implements its dlopen-like
feature in MS-Windows kernel which may be safe.  Contrary to it GNU/Linux
implements dlopen() fully in glibc - userland - calling from kernel only that
mmap() to map the .so file from disk, map some new pages of memory etc. By
having to modify the _r_debug.r_map link list which is in many times corrupted
when debugging crashed program GDB would crash the inferior even more on
'compile code' command.


Jan



More information about the Gdb-patches mailing list