This is the mail archive of the crossgcc@sources.redhat.com mailing list for the crossgcc project.

See the CrossGCC FAQ for lots more information.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: (#pragma data-seg) equivalent in Linux ...


Sir,
      Thanks for all the replies.
      Iam really not sure , but I think this is a
normal memory shared among multiple processes.In QT
based application(porting from MFC based app) this is
used in the following way:
      I have a main window in which I register my
window handle (save the self referencing pointer) in a
shared variable.Later Iam starting a new window(sort
of plugin) using execl and I want this plugin to
register itself to the main window using the already
stored main window handle in shared variable.
      In Windows this scenerio is implemented using
pragma directives etc.The segment name "SharedMem" is
never mentioned elsewhere and the members of this
segment will become globals and can be used by other
processes.
      Other reference (by Mr.Dan) is the following,but
Iam not so intellegent to understand what it means.
http://sources.redhat.com/ml/cygwin/1998-05/msg00599.html
      This discussion will be very interesting to a
beginner like me and hope to hear from you regarding
this.
       Sincerely,
Ram Kumar.


--- Carl Miller <chaz@energoncube.net> wrote:
> >       Right now Iam trying to port a windows
> > application onto Linux.But Iam struck with the
> > following implementation of windows specific
> > directives.How can I port this shared memory
> section
> > onto Linux ? Please help me in this
> regard...Thanking
> > you,
> > Ram Kumar.
> > 
> > #pragma data_seg("SharedMem")
> > #pragma bss_seg("SharedMem")
> > 
> > char    AppDesc[ MAX_PENCILS ][30];
> > 
> > #pragma data_seg()
> > #pragma bss_seg()
> > #pragma comment(linker, "/SECTION:SharedMem,rws")
> 
> Well, at first glance, I was about to recommend that
> this list might not be the best place to address
> that
> question, as crossgcc is primarily concerned with
> building, configuring, and using the GNU compiler
> collection and binary utilities as a cross-compiler
> (i.e. the machine the output program runs on is not
> the same as the machine the compiler runs on).
> 
> But on second glance, maybe it's not all that
> offtopic after all.  What little you've told us so
> far seems to be hinting toward a custom linker
> script, and this is one of the few places where
> GNU ld linker scripts get discussed in detail with
> regularity (just because they typically need to be
> customized a bit for each cross target, whereas a
> native compiler typically has a perfectly usable
> linker script right out of the box).
> 
> But in order to say more with any confidence, you'd
> need to tell us more about this shared memory
> segment.  What is it shared with?  How is it
> created?  Is it a range of memory-mapped hardware
> registers?  Is it an OS-managed segment of normal
> memory shared among multiple processes?  Using
> what API?  This "SharedMem" area must be mentioned
> elsewhere in the code, headers, or build scripts.
> What do the other references say about it?
> 
> 
>                    Carl Miller
>                    chaz@energoncube.net
> 
> ------
> Want more information?  See the CrossGCC FAQ,
> http://www.objsw.com/CrossGCC/
> Want to unsubscribe? Send a note to
> crossgcc-unsubscribe@sources.redhat.com
> 


__________________________________
Do you Yahoo!?
The New Yahoo! Shopping - with improved product search
http://shopping.yahoo.com

------
Want more information?  See the CrossGCC FAQ, http://www.objsw.com/CrossGCC/
Want to unsubscribe? Send a note to crossgcc-unsubscribe@sources.redhat.com


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]