Re: variables order(arrange)

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

 



On 04/08/14 07:40, Man Glory wrote:
Is there no easier way? Generally, it is very strange. In most
compilers I used earlier variables placed in memory one after another,
in the order they are declared in the program.  Or you had to use some
flag when compiling application. Applied to these solutions.
As far I understand, in order to place a section in the script I need
to know their names. How to find the names of the sections?
Not really. The compiler and linker are free to rearrange variable locations relative to each other. Depending on two variables to land physically in memory next to each other is, umm, bad practice.

If you absolutely must do that, then the way to go is to get those variables into their own sections then use a linker script to ensure those sections are adjacent.

Alternately, put them in a structure.

jeff






[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