Email: Password: Remember Me | Create Account (Free)

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
12/12/07 11:21
Read: times


 
#148096 - Linker segments
Responding to: ???'s previous message
Traditionally linkers manage code in so called segments. This means that code that is assumed to be of same type is relocated close to same type of company.

For example volatile variables are put into a segment that is relocated conveniently on top of RAM. This means that during the link process the object files are split into segments and then those different-type-of-segments are again glued together with other similar segments from other object files. So when the link process has done it's shoveling the code segment contains particles from many object files and so does the ram segment. The particles in a segment are then of course of same type.

What happens during that process is not exactly guaranteed. I have not seen a single linker that would guarantee the order of object particles inside a given segment. The only way I have found to guarantee a known place for an object is either to use ORG (or absolute addressing if You like) or create a private segment and then give the absolute address to that one.



List of 11 messages in thread
TopicAuthorDate
How to initialize Absolute variables in code mem?            01/01/70 00:00      
   The answer is here            01/01/70 00:00      
      Answer explained:            01/01/70 00:00      
         this is something Keil should implement            01/01/70 00:00      
            why do you need this?            01/01/70 00:00      
               Example            01/01/70 00:00      
                  OK, I accept            01/01/70 00:00      
   Why?            01/01/70 00:00      
   I would fall back to assy here            01/01/70 00:00      
      Not exactly true            01/01/70 00:00      
         Linker segments            01/01/70 00:00      

Back to Subject List