This is the mail archive of the
mailing list for the Cygwin project.
Re: [email@example.com: A serious bug of "ld --enable-auto-import"]
DJ Delorie wrote:
>>Here's what hello.o looks like when hello.c uses
>>__declspec(dllimport) (and hwstr.c uses __declspec(dllexport)).
>>Recall that this configuration works as expected.
> Right, because we're effectively telling gcc that hwstr1 is a pointer,
> not an array. That changes how gcc generates code. Pointers must be
> indexed at runtime, arrays may be indexed at compile time.
Well, that's interesting. Since arrays ARE pointers(*), then perhaps
it's enough to change gcc's behavior from
"arrays may be indexed at compile time" -- and currently, ARE indexed at
arrays indexed at runtime. (for pe-i386 targets)
That leaves two questions:
a) will it fix the observed problem
b) will gcc accept it
(Is there a gcc option to force runtime indexing of arrays?)
(*) okay, I'm C-biased. I'm not sure how a change of the type proposed
here would affect C++, Fortran, Ada, Java, .... but turning OFF this
optimization shouldn't break anything, should it?
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple
Bug reporting: http://cygwin.com/bugs.html