This is the mail archive of the
cygwin-apps
mailing list for the Cygwin project.
Re: 64bit: cygstdc++-6.dll
- From: Corinna Vinschen <corinna-cygwin at cygwin dot com>
- To: cygwin-apps at cygwin dot com
- Cc: Kai Tietz <ktietz at redhat dot com>
- Date: Sun, 14 Apr 2013 10:25:12 +0200
- Subject: Re: 64bit: cygstdc++-6.dll
- References: <51643DC1 dot 2070407 at gmail dot com> <5165377D dot 3080208 at users dot sourceforge dot net> <516589ED dot 3090909 at gmail dot com> <20130410161622 dot GC5138 at calimero dot vinschen dot de> <20130411101639 dot GB12461 at calimero dot vinschen dot de> <20130411133759 dot GC18333 at calimero dot vinschen dot de> <20130412155750 dot GG11358 at calimero dot vinschen dot de> <51686F09 dot 4050009 at gmail dot com> <20130413100751 dot GI11358 at calimero dot vinschen dot de> <5169BB2E dot 80807 at gmail dot com>
- Reply-to: cygwin-apps at cygwin dot com
On Apr 13 21:08, Dave Korn wrote:
> On 13/04/2013 11:07, Corinna Vinschen wrote:
> > On Apr 12 21:31, Dave Korn wrote:
>
> >> Nope, just vague about input and output sections. Enabling auto imports
> >> selects a linker script that causes all the .rdata in the input object files
> >
> > Out of curiosity, which linker script is that? What's the difference
> > to the "normal" one?
>
> Well, since auto import became the default, it is "the normal one", but that
> aside, they're both built-in scripts. Compare the output from "ld
> --disable-auto-import --verbose" and "ld --verbose" to see the difference. Or
> you can look at the copies that ld installs into
> /usr/i686-pc-cygwin/lib/ldscripts/; the .x file is the plain one, the .xa is
> the auto-import one.
I'm puzzled. The .xa file supposedly foldes *all* of .rdata into the
.data section. So an executable built with --auto-import should have no
.rdata section, right? And since auto-import is on by default, none of our
binaries should have an .rdata section. But they have. I notice that
the 32 bit DLLs don't have a .rdata section, though. Does that mean
auto-import only influences DLLs?
I also notice that 64 bit binaries and DLLs both have .rdata sections.
But AFAICS, auto-import is enabled for 64 bit, too.
> > I'm a bit puzzled in terms of the additional R/W space this amounts to.
> > When loading an executable, there is the entire IAT which has to be
> > modified by the loader, anyway. That includes all functions and data
> > imported from other DLLs. To what extent do the auto-import entries add
> > to that? If it's just another indirection, that would add 5 bytes
> > (absolute jmp) on i686, and 8 bytes (an absolute address in a pseudo-GOT
> > table) on x86_64 per auto-imported symbol. That's not a lot, probably
> > not even a 4K page per executable. How significant is that?
>
> But it's not a separate contiguous list of pointers. What's happening is
> that there are various structures in the .rdata that contain imported
> pointers. They'll be scattered throughout the .rdata, along with all the
> other const data that /doesn't/ have pointers that have to be auto-imported.
> So depending on the percentages and how it happens to end up in the link
> order, it could be any or all of the .rdata pages that get COWed on startup.
Why is that so? Isn't that, in theory, a problem of gcc not sorting the
data in a way which decouples auto-imported stuff from not-auto-imported
stuff? Couldn't a gcc fix allow to separate them out into their own
.data_auto_import section which is then folded into .data at link time,
leaving the .rdata stuff alone?
Kai, how much of this is relevant for x86_64?
Corinna
--
Corinna Vinschen Please, send mails regarding Cygwin to
Cygwin Maintainer cygwin AT cygwin DOT com
Red Hat