Need information about data and bss segment address access in cygwin

Cliff Hones cliff@hones.org.uk
Fri Jan 20 12:26:00 GMT 2006


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/



More information about the Cygwin mailing list