X-Spam-Check-By: sourceware.org
Message-ID: <43D0D06C.3010906@hones.org.uk>
Date: Fri, 20 Jan 2006 11:58:36 +0000
From: Cliff Hones <cliff@hones.org.uk>
User-Agent: Mozilla Thunderbird 1.0 (Windows/20041206)
MIME-Version: 1.0
To: cygwin@cygwin.com
Subject: Re: Need information about data and bss segment address access in  cygwin
References: <46ca01fa0601200308r100244eerd9fc2ce933af6f51@mail.gmail.com> 	 <SERRANOng8FSZDhd2st00000235@SERRANO.CAM.ARTIMI.COM> <46ca01fa0601200345h788d0de8v39236e1d46c6a219@mail.gmail.com>
In-Reply-To: <46ca01fa0601200345h788d0de8v39236e1d46c6a219@mail.gmail.com>
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit
X-Spam-Score: -2.5 (--)
X-IsSubscribed: yes
Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe@cygwin.com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin@cygwin.com>
List-Help: <mailto:cygwin-help@cygwin.com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner@cygwin.com
Mail-Followup-To: cygwin@cygwin.com
Delivered-To: mailing list cygwin@cygwin.com

Sudhahar wrote:
> Thanks Dave your reply answered the question where they declared. But
> how does these variables get the segment address of data and bss for a
> running process to make a copy to the child process? This is the
> questions which is a puzzle to me.

The linker places these variables at the start and end of the data and
bss segments.  The application can then find the addresses of the segments
by taking the address of the variables (eg &__data_start__).  They aren't
strictly variables in the C sense, inasmuch as trying to read or assign
to them may corrupt your application or cause a segmentation error.

Look in winsup/cygwin/lib/_cygwin_crt0_common.cc

-- Cliff

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

