This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Starterware Application stack allocated beyond available memory address

Hi,

I have a AM335x based board with 1 GB RAM (DDR3). I have defined a memory Section in linker command file as follows

MEMORY
{
DDR_MEM : org = 0x80000000 len = 0x40000000 /* This is 1GB length*/ 
}

/* SPECIFY THE SECTIONS ALLOCATION INTO MEMORY */

SECTIONS
{
.text:Entry : load > 0x80000000

.text : load > DDR_MEM /* CODE */
.data : load > DDR_MEM /* INITIALIZED GLOBAL AND STATIC VARIABLES */
.bss : load > DDR_MEM /* UNINITIALIZED OR ZERO INITIALIZED */
/* GLOBAL & STATIC VARIABLES */
RUN_START(bss_start)
RUN_END(bss_end)
.const : load > DDR_MEM /* GLOBAL CONSTANTS */
.stack : load > 0xDFFFFF00  /*Beyond 1GB*/ 
}

So the length is set to 0x40000000 which is 1 GB which is available DDR3 in my board. Now i just tried to allocate stack beyond 1GB with .stack : load > 0xDFFFFF00  /*Beyond 1GB*/ ( 0x80000000 to 0xC0000000 is available 1GB memory range). I declared a local buffer of size 1 k in the main and built the code and ran. I noticed that the local buffer is allocated stack in the address 0xDFFFCECC.

The application runs fine but my question is how does the stack gets allocated beyond the available memory address and how the code runs without any problems?

Please suggest. The map file it generates is as attached.

******************************************************************************
                  TI ARM Linker PC v5.2.5                      
******************************************************************************
>> Linked Mon Jan 25 17:59:22 2016

OUTPUT FILE NAME:   <../../../../../../../binary/armv7a/cgt_ccs/am335x/beaglebone/dmtimer/Debug/dmtimerCounter.out>
ENTRY POINT SYMBOL: "Entry"  address: 80000000


MEMORY CONFIGURATION

         name            origin    length      used     unused   attr    fill
----------------------  --------  ---------  --------  --------  ----  --------
  DDR_MEM               80000000   40000000  00045bed  3ffba413  RWIX


SEGMENT ALLOCATION MAP

run origin  load origin   length   init length attrs members
----------  ----------- ---------- ----------- ----- -------
80000000    80000000    000000cc   000000cc    r-x
  80000000    80000000    000000cc   000000cc    r-x .text:Entry
800000cc    800000cc    00040000   00040000    rw-
  800000cc    800000cc    00040000   00040000    rw- .data
800400cc    800400cc    000058cc   000058cc    r-x
  800400cc    800400cc    000058cc   000058cc    r-x .text
80045998    80045998    00000201   00000000    rw-
  80045998    80045998    00000201   00000000    rw- .bss
80045b9c    80045b9c    00000054   00000054    r--
  80045b9c    80045b9c    00000054   00000054    r-- .const
dfffff00    dfffff00    00000008   00000000    rw-
  dfffff00    dfffff00    00000008   00000000    rw- .stack


SECTION ALLOCATION MAP

 output                                  attributes/
section   page    origin      length       input sections
--------  ----  ----------  ----------   ----------------
.text:Entry 
*          0    80000000    000000cc     
                  80000000    000000c4     system.lib : init.obj (.text:Entry)
                  800000c4    00000008     rtsv7A8_A_le_eabi.lib : autoinit.obj (.tramp.__TI_auto_init.1)

.data      0    800000cc    00040000     
                  800000cc    00040000     dmtimerCounter.obj (.data:buf_global)

.TI.persistent 
*          0    800000cc    00000000     UNINITIALIZED

.text      0    800400cc    000058cc     
                  800400cc    00002048     utils.lib : uartStdio.obj (.text)
                  80042114    00001d10     drivers.lib : uart_irda_cir.obj (.text)
                  80043e24    00000638     utils.lib : ascii.obj (.text)
                  8004445c    00000488     system.lib : cp15.obj (.text)
                  800448e4    0000046c     platform.lib : uart.obj (.text)
                  80044d50    000002e4     utils.lib : consoleUtils.obj (.text)
                  80045034    00000280     platform.lib : uartConsole.obj (.text)
                  800452b4    00000180     rtsv7A8_A_le_eabi.lib : memcpy32.obj (.text)
                  80045434    0000010c     system.lib : exceptionhandler.obj (.text)
                  80045540    00000104     dmtimerCounter.obj (.text)
                  80045644    000000f0     rtsv7A8_A_le_eabi.lib : u_div32.obj (.text)
                  80045734    000000b0                           : memset32.obj (.text)
                  800457e4    000000a4                           : autoinit.obj (.text)
                  80045888    00000088     system.lib : startup.obj (.text)
                  80045910    00000084     rtsv7A8_A_le_eabi.lib : cpy_tbl.obj (.text)
                  80045994    00000004                           : i_div0.obj (.text)

.bss       0    80045998    00000201     UNINITIALIZED
                  80045998    00000200     system.lib : interrupt.obj (.bss:fnRAMVectors)
                  80045b98    00000001     (.common:ConsoleType)

.TI.noinit 
*          0    80045998    00000000     UNINITIALIZED

.const     0    80045b9c    00000054     
                  80045b9c    00000038     system.lib : startup.obj (.const:vecTbl)
                  80045bd4    00000014     utils.lib : uartStdio.obj (.const:.string)
                  80045be8    00000004     system.lib : startup.obj (.const)
                  80045bec    00000004     utils.lib : uartStdio.obj (.const)

.stack     0    dfffff00    00000008     UNINITIALIZED
                  dfffff00    00000008     --HOLE--


FAR CALL TRAMPOLINES

callee name               trampoline name
   callee addr  tramp addr   call addr  call info
--------------  -----------  ---------  ----------------
__TI_auto_init            $Tramp$AA$S$$__TI_auto_init
   800457e4     800000c4     8000009c   system.lib : init.obj (.text:Entry)

[1 trampolines]
[1 trampoline calls]


GLOBAL SYMBOLS: SORTED ALPHABETICALLY BY Name 

address   name                           
-------   ----                           
80045be8  AM335X_VECTOR_BASE             
80043e24  ASCIIToDigit                   
80045528  AbortHandler                   
800448b8  CP15AuxControlFeatureDisable   
800448a4  CP15AuxControlFeatureEnable    
8004484c  CP15BranchPredictionDisable    
8004483c  CP15BranchPredictionEnable     
80044830  CP15BranchPredictorInvalidate  
8004486c  CP15ControlFeatureDisable      
80044880  CP15ControlFeatureEnable       
80044548  CP15DCacheClean                
80044680  CP15DCacheCleanBuff            
800445dc  CP15DCacheCleanFlush           
800446d4  CP15DCacheCleanFlushBuff       
80044478  CP15DCacheDisable              
800444a4  CP15DCacheEnable               
800444b4  CP15DCacheFlush                
80044728  CP15DCacheFlushBuff            
8004485c  CP15DomainAccessClientSet      
8004445c  CP15ICacheDisable              
80044494  CP15ICacheEnable               
80044670  CP15ICacheFlush                
8004478c  CP15ICacheFlushBuff            
800447f8  CP15MMUDisable                 
80044810  CP15MMUEnable                  
800448cc  CP15MainIdPrimPartNumGet       
800447ec  CP15TlbInvalidate              
800447e0  CP15Ttb0Set                    
80044894  CP15TtbCtlTtb0Config           
80044824  CP15VectorBaseAddrSet          
80045904  CPUAbortHandler                
80044f3c  ConsoleUtilsGetChar            
80044eb4  ConsoleUtilsGets               
80044d50  ConsoleUtilsInit               
80044d5c  ConsoleUtilsInit1              
80044d9c  ConsoleUtilsPrintf             
80044df4  ConsoleUtilsPrintf1            
80044fac  ConsoleUtilsPutChar            
80044f00  ConsoleUtilsPuts               
80044e4c  ConsoleUtilsScanf              
80044d68  ConsoleUtilsSetType            
80044314  DateToStr                      
80043ef8  DigitToASCII                   
80000000  Entry                          
800440a8  EthrAddrToStr                  
80045524  FIQHandler                     
80045478  IRQHandler                     
UNDEFED   SHT$$INIT_ARRAY$$Base          
UNDEFED   SHT$$INIT_ARRAY$$Limit         
80045450  SVC_Handler                    
80043f94  StrToEthrAddr                  
800441cc  TimeToStr                      
8004493c  UART0ModuleClkConfig           
80043754  UARTAutoIdleModeControl        
80043500  UARTAutoRTSAutoCTSControl      
80043c3c  UARTAutobaudParityGet          
80043cd4  UARTAutobaudSpeedGet           
80043c88  UARTAutobaudWordLenGet         
8004249c  UARTBreakCtl                   
800431dc  UARTCharGet                    
80043184  UARTCharGetNonBlocking         
80043234  UARTCharGetTimeout             
800432c4  UARTCharPut                    
80043118  UARTCharPutNonBlocking         
800430c4  UARTCharsAvail                 
8004528c  UARTConsoleGetc                
8004520c  UARTConsoleInit                
80045234  UARTConsoleInit1               
8004525c  UARTConsolePutc                
80045274  UARTConsolePutc1               
80043bac  UARTDMACounterResetControl     
800429d8  UARTDMADisable                 
8004297c  UARTDMAEnable                  
80043ac4  UARTDSRInterruptControl        
800423e0  UARTDivisorLatchDisable        
800423bc  UARTDivisorLatchEnable         
80042238  UARTDivisorLatchWrite          
80042174  UARTDivisorValCompute          
80042afc  UARTEnhanFuncBitValRestore     
80042a9c  UARTEnhanFuncEnable            
80043338  UARTFIFOCharGet                
80043318  UARTFIFOCharPut                
800425b8  UARTFIFOConfig                 
800434ac  UARTFIFOEnableStatusGet        
80042a10  UARTFIFORegisterWrite          
80043a60  UARTFIFOTrigLvlGranControl     
80043354  UARTFIFOWrite                  
80043798  UARTFlowCtrlTrigLvlConfig      
80040680  UARTGetHexNum                  
800405cc  UARTGetNum                     
80040900  UARTGetc                       
800402f8  UARTGets                       
800436cc  UARTIdleModeConfigure          
80042fa8  UARTIntDisable                 
80042ec4  UARTIntEnable                  
8004340c  UARTIntIdentityGet             
80043458  UARTIntPendingStatusGet        
800424e0  UARTLineCharacConfig           
8004390c  UARTLoopbackModeControl        
80043980  UARTModemControlClear          
80043950  UARTModemControlSet            
800439cc  UARTModemStatusChangeCheck     
800439b0  UARTModemStatusGet             
80044b44  UARTModuleClkConfig            
80043698  UARTModuleReset                
80043d80  UARTModuleVersionNumberGet     
80042114  UARTOperatingModeSelect        
8004259c  UARTParityModeGet              
80042558  UARTParityModeSet              
800448e4  UARTPinMuxSetup                
80041700  UARTPrintf                     
80041c08  UARTPrintf1                    
80043654  UARTPulseShapingControl        
800404a0  UARTPutHexNum                  
800403a4  UARTPutNum                     
800408d8  UARTPutc                       
800408ec  UARTPutc1                      
80040188  UARTPuts                       
80040240  UARTPuts1                      
80043b90  UARTRXCTSDSRTransitionStatusGet
80043b4c  UARTRXCTSDSRWakeUpConfigure    
8004247c  UARTRegConfModeRestore         
80042404  UARTRegConfigModeEnable        
800439e8  UARTResumeOperation            
800433c0  UARTRxErrorGet                 
80043c24  UARTRxFIFOLevelGet             
80040f18  UARTScanf                      
80043d64  UARTScratchPadRegRead          
80043d20  UARTScratchPadRegWrite         
800435f0  UARTSoftwareFlowCtrlOptSet     
80043070  UARTSpaceAvail                 
8004358c  UARTSpecialCharDetectControl   
80040170  UARTStdioInit                  
8004017c  UARTStdioInit1                 
80042b60  UARTSubConfigMSRSPRModeEn      
80042c38  UARTSubConfigTCRTLRModeEn      
80042d10  UARTSubConfigXOFFModeEn        
80042de8  UARTTCRTLRBitValRestore        
80043d9c  UARTTxDMAThresholdControl      
80043de0  UARTTxDMAThresholdValConfig    
80043b08  UARTTxEmptyIntControl          
80043bf0  UARTTxFIFOFullStatusGet        
80043c0c  UARTTxFIFOLevelGet             
80043710  UARTWakeUpControl              
80043a30  UARTWakeUpEventsDisable        
80043a00  UARTWakeUpEventsEnable         
800437e8  UARTXON1XOFF1ValProgram        
80043818  UARTXON2XOFF2ValProgram        
80043848  UARTXONAnyFeatureControl       
800409f4  UARTprintf                     
8004090c  UARTwrite                      
80040980  UARTwrite1                     
80045528  UndefInstHandler               
dfffff08  __STACK_END                    
00000008  __STACK_SIZE                   
UNDEFED   __TI_CINIT_Base                
UNDEFED   __TI_CINIT_Limit               
UNDEFED   __TI_Handler_Table_Base        
UNDEFED   __TI_Handler_Table_Limit       
800457e4  __TI_auto_init                 
80000000  __TI_static_base__             
80045994  __aeabi_idiv0                  
80045734  __aeabi_memclr                 
80045734  __aeabi_memclr4                
80045734  __aeabi_memclr8                
800452b4  __aeabi_memcpy                 
800452b4  __aeabi_memcpy4                
800452b4  __aeabi_memcpy8                
80045738  __aeabi_memset                 
80045738  __aeabi_memset4                
80045738  __aeabi_memset8                
80045644  __aeabi_uidiv                  
80045644  __aeabi_uidivmod               
ffffffff  __binit__                      
ffffffff  __c_args__                     
dfffff00  __stack                        
ffffffff  binit                          
80045b99  bss_end                        
80045998  bss_start                      
800000cc  buf_global                     
80045910  copy_in                        
80045998  fnRAMVectors                   
80045540  main                           
800452b4  memcpy                         
80045744  memset                         
80045888  start_boot                     


GLOBAL SYMBOLS: SORTED BY Symbol Address 

address   name                           
-------   ----                           
00000008  __STACK_SIZE                   
80000000  Entry                          
80000000  __TI_static_base__             
800000cc  buf_global                     
80040170  UARTStdioInit                  
8004017c  UARTStdioInit1                 
80040188  UARTPuts                       
80040240  UARTPuts1                      
800402f8  UARTGets                       
800403a4  UARTPutNum                     
800404a0  UARTPutHexNum                  
800405cc  UARTGetNum                     
80040680  UARTGetHexNum                  
800408d8  UARTPutc                       
800408ec  UARTPutc1                      
80040900  UARTGetc                       
8004090c  UARTwrite                      
80040980  UARTwrite1                     
800409f4  UARTprintf                     
80040f18  UARTScanf                      
80041700  UARTPrintf                     
80041c08  UARTPrintf1                    
80042114  UARTOperatingModeSelect        
80042174  UARTDivisorValCompute          
80042238  UARTDivisorLatchWrite          
800423bc  UARTDivisorLatchEnable         
800423e0  UARTDivisorLatchDisable        
80042404  UARTRegConfigModeEnable        
8004247c  UARTRegConfModeRestore         
8004249c  UARTBreakCtl                   
800424e0  UARTLineCharacConfig           
80042558  UARTParityModeSet              
8004259c  UARTParityModeGet              
800425b8  UARTFIFOConfig                 
8004297c  UARTDMAEnable                  
800429d8  UARTDMADisable                 
80042a10  UARTFIFORegisterWrite          
80042a9c  UARTEnhanFuncEnable            
80042afc  UARTEnhanFuncBitValRestore     
80042b60  UARTSubConfigMSRSPRModeEn      
80042c38  UARTSubConfigTCRTLRModeEn      
80042d10  UARTSubConfigXOFFModeEn        
80042de8  UARTTCRTLRBitValRestore        
80042ec4  UARTIntEnable                  
80042fa8  UARTIntDisable                 
80043070  UARTSpaceAvail                 
800430c4  UARTCharsAvail                 
80043118  UARTCharPutNonBlocking         
80043184  UARTCharGetNonBlocking         
800431dc  UARTCharGet                    
80043234  UARTCharGetTimeout             
800432c4  UARTCharPut                    
80043318  UARTFIFOCharPut                
80043338  UARTFIFOCharGet                
80043354  UARTFIFOWrite                  
800433c0  UARTRxErrorGet                 
8004340c  UARTIntIdentityGet             
80043458  UARTIntPendingStatusGet        
800434ac  UARTFIFOEnableStatusGet        
80043500  UARTAutoRTSAutoCTSControl      
8004358c  UARTSpecialCharDetectControl   
800435f0  UARTSoftwareFlowCtrlOptSet     
80043654  UARTPulseShapingControl        
80043698  UARTModuleReset                
800436cc  UARTIdleModeConfigure          
80043710  UARTWakeUpControl              
80043754  UARTAutoIdleModeControl        
80043798  UARTFlowCtrlTrigLvlConfig      
800437e8  UARTXON1XOFF1ValProgram        
80043818  UARTXON2XOFF2ValProgram        
80043848  UARTXONAnyFeatureControl       
8004390c  UARTLoopbackModeControl        
80043950  UARTModemControlSet            
80043980  UARTModemControlClear          
800439b0  UARTModemStatusGet             
800439cc  UARTModemStatusChangeCheck     
800439e8  UARTResumeOperation            
80043a00  UARTWakeUpEventsEnable         
80043a30  UARTWakeUpEventsDisable        
80043a60  UARTFIFOTrigLvlGranControl     
80043ac4  UARTDSRInterruptControl        
80043b08  UARTTxEmptyIntControl          
80043b4c  UARTRXCTSDSRWakeUpConfigure    
80043b90  UARTRXCTSDSRTransitionStatusGet
80043bac  UARTDMACounterResetControl     
80043bf0  UARTTxFIFOFullStatusGet        
80043c0c  UARTTxFIFOLevelGet             
80043c24  UARTRxFIFOLevelGet             
80043c3c  UARTAutobaudParityGet          
80043c88  UARTAutobaudWordLenGet         
80043cd4  UARTAutobaudSpeedGet           
80043d20  UARTScratchPadRegWrite         
80043d64  UARTScratchPadRegRead          
80043d80  UARTModuleVersionNumberGet     
80043d9c  UARTTxDMAThresholdControl      
80043de0  UARTTxDMAThresholdValConfig    
80043e24  ASCIIToDigit                   
80043ef8  DigitToASCII                   
80043f94  StrToEthrAddr                  
800440a8  EthrAddrToStr                  
800441cc  TimeToStr                      
80044314  DateToStr                      
8004445c  CP15ICacheDisable              
80044478  CP15DCacheDisable              
80044494  CP15ICacheEnable               
800444a4  CP15DCacheEnable               
800444b4  CP15DCacheFlush                
80044548  CP15DCacheClean                
800445dc  CP15DCacheCleanFlush           
80044670  CP15ICacheFlush                
80044680  CP15DCacheCleanBuff            
800446d4  CP15DCacheCleanFlushBuff       
80044728  CP15DCacheFlushBuff            
8004478c  CP15ICacheFlushBuff            
800447e0  CP15Ttb0Set                    
800447ec  CP15TlbInvalidate              
800447f8  CP15MMUDisable                 
80044810  CP15MMUEnable                  
80044824  CP15VectorBaseAddrSet          
80044830  CP15BranchPredictorInvalidate  
8004483c  CP15BranchPredictionEnable     
8004484c  CP15BranchPredictionDisable    
8004485c  CP15DomainAccessClientSet      
8004486c  CP15ControlFeatureDisable      
80044880  CP15ControlFeatureEnable       
80044894  CP15TtbCtlTtb0Config           
800448a4  CP15AuxControlFeatureEnable    
800448b8  CP15AuxControlFeatureDisable   
800448cc  CP15MainIdPrimPartNumGet       
800448e4  UARTPinMuxSetup                
8004493c  UART0ModuleClkConfig           
80044b44  UARTModuleClkConfig            
80044d50  ConsoleUtilsInit               
80044d5c  ConsoleUtilsInit1              
80044d68  ConsoleUtilsSetType            
80044d9c  ConsoleUtilsPrintf             
80044df4  ConsoleUtilsPrintf1            
80044e4c  ConsoleUtilsScanf              
80044eb4  ConsoleUtilsGets               
80044f00  ConsoleUtilsPuts               
80044f3c  ConsoleUtilsGetChar            
80044fac  ConsoleUtilsPutChar            
8004520c  UARTConsoleInit                
80045234  UARTConsoleInit1               
8004525c  UARTConsolePutc                
80045274  UARTConsolePutc1               
8004528c  UARTConsoleGetc                
800452b4  __aeabi_memcpy                 
800452b4  __aeabi_memcpy4                
800452b4  __aeabi_memcpy8                
800452b4  memcpy                         
80045450  SVC_Handler                    
80045478  IRQHandler                     
80045524  FIQHandler                     
80045528  AbortHandler                   
80045528  UndefInstHandler               
80045540  main                           
80045644  __aeabi_uidiv                  
80045644  __aeabi_uidivmod               
80045734  __aeabi_memclr                 
80045734  __aeabi_memclr4                
80045734  __aeabi_memclr8                
80045738  __aeabi_memset                 
80045738  __aeabi_memset4                
80045738  __aeabi_memset8                
80045744  memset                         
800457e4  __TI_auto_init                 
80045888  start_boot                     
80045904  CPUAbortHandler                
80045910  copy_in                        
80045994  __aeabi_idiv0                  
80045998  bss_start                      
80045998  fnRAMVectors                   
80045b99  bss_end                        
80045be8  AM335X_VECTOR_BASE             
dfffff00  __stack                        
dfffff08  __STACK_END                    
ffffffff  __binit__                      
ffffffff  __c_args__                     
ffffffff  binit                          
UNDEFED   SHT$$INIT_ARRAY$$Base          
UNDEFED   SHT$$INIT_ARRAY$$Limit         
UNDEFED   __TI_CINIT_Base                
UNDEFED   __TI_CINIT_Limit               
UNDEFED   __TI_Handler_Table_Base        
UNDEFED   __TI_Handler_Table_Limit       

[186 symbols]