public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
* static and global variables allocation
@ 2009-12-13 23:36 PhDUCSB
  2009-12-16  1:10 ` Ian Lance Taylor
  0 siblings, 1 reply; 2+ messages in thread
From: PhDUCSB @ 2009-12-13 23:36 UTC (permalink / raw)
  To: gcc-help


I want to know which files in the gcc compiler deals with static and global
variable allocations because I would like to change the place they are
allocated at in memory. Any help would be appreciated. Thanks, 
-- 
View this message in context: http://old.nabble.com/static-and-global-variables-allocation-tp26770061p26770061.html
Sent from the gcc - Help mailing list archive at Nabble.com.

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: static and global variables allocation
  2009-12-13 23:36 static and global variables allocation PhDUCSB
@ 2009-12-16  1:10 ` Ian Lance Taylor
  0 siblings, 0 replies; 2+ messages in thread
From: Ian Lance Taylor @ 2009-12-16  1:10 UTC (permalink / raw)
  To: PhDUCSB; +Cc: gcc-help

PhDUCSB <eng.hmohsen@gmail.com> writes:

> I want to know which files in the gcc compiler deals with static and global
> variable allocations because I would like to change the place they are
> allocated at in memory. Any help would be appreciated. Thanks, 

They are handled in gcc/varasm.c.  However, if what you care about is
where they wind up in memory, then you probably don't want to fiddle
with gcc.  It is the linker which lays variables out in memory.  One
approach is to group variables into sections using the section
attribute.  Then use a linker script to put the sections at the
addresses you want.

Ian

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2009-12-16  1:07 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-12-13 23:36 static and global variables allocation PhDUCSB
2009-12-16  1:10 ` Ian Lance Taylor

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).