Re: static and global variables allocation

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



PhDUCSB <eng.hmohsen@xxxxxxxxx> 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

[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux