[PATCH RFC] fork: reduce chances for "address space is already occupied" errors

Corinna Vinschen corinna-cygwin@cygwin.com
Sat Apr 13 08:20:00 GMT 2019


On Apr 13 09:46, Achim Gratz wrote:
> Corinna Vinschen writes:
> > Nick Clifton, one of the binutils maintainers, made the following
> > suggestion in PM:
> >
> > Allow the ld flag --enable-auto-image-base to take a filename as
> > argument.
> >
> > The idea: The file is used by ld to generate the start address
> > for the next built DLL.  Mechanism:
> >
> > 1.1. If ld links a DLL and if the file given to --enable-auto-image-base
> >      doesn't exist, ld will give the DLL the start address of the
> >      auto image base range.
> >
> > 1.2: Next time, if ld links a DLL and if the file given to
> >      --enable-auto-image-base exists, it will use the address in that
> >      file as the start address for th just built DLL.
> >
> > 2. It will store that address, plus the size of the DLL, rounded up to
> >    64K, in that file.
> >
> > 3. If the auto image base range is at an end, ld will wrap back to
> >    the start address of the auto image base range.
> 
> Sounds OK if the goal is just to avoid collisions, but it would really
> be nicer if there was some way to plug this together with the rebase
> database from the start.

No, that's contrary to the idea.  The solution should be self-sufficient
within binutils.  We don't want to add any reliance to external tools.

The linker uses a DLL address space which does not collide with rebased
DLLs in 64 bit, so this only occurs during developement, and none of the
built DLLs can collide with system DLLs.  I do not much care for 32 bit,
it's a lost case anyway.


Corinna

-- 
Corinna Vinschen
Cygwin Maintainer
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <http://cygwin.com/pipermail/cygwin-patches/attachments/20190413/7b7088f2/attachment.sig>


More information about the Cygwin-patches mailing list