delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin-developers/1998/10/02/11:50:29

From: khan AT xraylith DOT wisc DOT edu (Mumit Khan)
Subject: Re: egcs-1.1b
2 Oct 1998 11:50:29 -0700 :
Message-ID: <9810021835.AA15557.cygnus.cygwin32.developers@modi.xraylith.wisc.edu>
References: <19981002085228 DOT B12119 AT cygnus DOT com>
To: Christopher Faylor <cgf AT cygnus DOT com>
Cc: Corinna Vinschen <corinna DOT vinschen AT cityweb DOT de>,
cygwin32-developers AT cygnus DOT com

Christopher Faylor <cgf AT cygnus DOT com> writes:
> >Erasing `const' works, but I don't understand, what happens.
> >Is it a bug or am I too dull or what?

Corrina, When you say egcs-1.1b, does it mean that you built the compiler 
yourself from egcs-1.1b source? If so, did you add any of the patches? 

> Yow.  It sounds like constants are being put in their own section
> now.  Since fork doesn't know about this section, it won't be
> copied anyway so you can safely remove the NO_COPY attribute.

The C++ front-end puts const data in .text section right now unless
of course you supply an explicit section directive, as done in the
example here. It will be copied on fork in the current scheme of course,
and using NO_COPY will do the right thing if you don't want it copied 
on fork.

> 
> Maybe Mumit can comment on this "theory".
> 

I can comment, but doesn't mean I can shed any light on it ;-) I'll try 
to build everything over the weekend (I assume that report is about 
building the new winsup or b20a2 snapshot with egcs-1.1), and see if I 
can reproduce this. Note that I did build b20a1 with egcs-1.1 and ended 
up with a runnable DLL. 

The construct should work just fine, and it does so with my copy of
egcs-1.1. Here's what I see:

% i386-cygwin32-gcc -fno-rtti -fno-exceptions -c section-code.cc
[ note: don't use -O2 in this case, or else it'll get optimized away ]
% i386-cygwin32-objdump -h

section-code.o:     file format pe-i386

Sections:
Idx Name          Size      VMA       LMA       File off  Algn
  0 .text         00000000  00000000  00000000  00000000  2**2
                  ALLOC, LOAD, CODE
  1 .data         00000000  00000000  00000000  00000000  2**2
                  ALLOC, LOAD, DATA
  2 .bss          00000000  00000000  00000000  00000000  2**2
                  ALLOC
  3 .data_cygwin_nocopy 00000004  00000000  00000000  000000b4  2**2
                  CONTENTS, ALLOC, LOAD


Could you rebuild with -O2 (so that it's optimized away) and see if you
still get the error?

Regards,
Mumit

- Raw text -


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