delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2001/08/26/12:05:28

Mailing-List: contact cygwin-help AT sourceware DOT cygnus DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT sources DOT redhat DOT com>
List-Archive: <http://sources.redhat.com/ml/cygwin/>
List-Post: <mailto:cygwin AT sources DOT redhat DOT com>
List-Help: <mailto:cygwin-help AT sources DOT redhat DOT com>, <http://sources.redhat.com/ml/#faqs>
Sender: cygwin-owner AT sources DOT redhat DOT com
Delivered-To: mailing list cygwin AT sources DOT redhat DOT com
Message-ID: <3B891E23.9090407@ece.gatech.edu>
Date: Sun, 26 Aug 2001 12:04:51 -0400
From: Charles Wilson <cwilson AT ece DOT gatech DOT edu>
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:0.9.2) Gecko/20010713
X-Accept-Language: en-us
MIME-Version: 1.0
To: DJ Delorie <dj AT delorie DOT com>
CC: binutils AT sources DOT redhat DOT com, cygwin AT cygwin DOT com
Subject: Re: [aida_s AT mx12 DOT freecom DOT ne DOT jp: A serious bug of "ld --enable-auto-import"]
References: <3B8884F6 DOT 80708 AT ece DOT gatech DOT edu> <200108260530 DOT BAA28221 AT envy DOT delorie DOT com> <3B888D76 DOT 6090102 AT ece DOT gatech DOT edu> <200108260613 DOT CAA28557 AT envy DOT delorie DOT com> <3B891172 DOT 9000207 AT ece DOT gatech DOT edu> <200108261543 DOT LAA06415 AT envy DOT delorie DOT com>

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 
compile time

to

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?)

--Chuck

(*) 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
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019