Advertisement
Guest User

Untitled

a guest
Jul 5th, 2017
56
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. OUTPUT_FORMAT("elf32-littlearm", "elf32-bigarm", "elf32-littlearm")
  2. OUTPUT_ARCH(arm)
  3. ENTRY(_start)
  4.  
  5. MEMORY {
  6.     itcm  : ORIGIN = 0x01FF8000, LENGTH = 32K
  7.     ewram : ORIGIN = 0x02000800, LENGTH = 4M
  8.     dtcm  : ORIGIN = 0x027E0000, LENGTH = 16K
  9. }
  10.  
  11. /* Memory Sections */
  12. __itcm__     = ORIGIN(itcm);
  13. __dtcm__     = ORIGIN(dtcm);
  14. __itcm_bot__ = ORIGIN(itcm);
  15. __dtcm_bot__ = ORIGIN(dtcm);
  16. __itcm_top__ = ORIGIN(itcm) + LENGTH(itcm);
  17. __dtcm_top__ = ORIGIN(dtcm) + LENGTH(dtcm);
  18.  
  19. /* Stack Config */
  20. __sp_len__ = 0x200;
  21. __sp_irq__ = __dtcm_top__ - (__sp_len__*1);
  22. __sp_svc__ = __dtcm_top__ - (__sp_len__*2);
  23. __sp_usr__ = __dtcm_top__ - (__sp_len__*3);
  24.  
  25. SECTIONS {
  26.     . = ORIGIN(ewram);
  27.     __text_bot__ = . ;
  28.    
  29.     .init : {
  30.         KEEP (*(.init))
  31.         . = ALIGN(4);
  32.     } >ewram
  33.    
  34.     .plt : {
  35.         *(.plt)
  36.         . = ALIGN(4);
  37.     } >ewram
  38.    
  39.     .text : {
  40.         *(EXCLUDE_FILE (*.itcm*) .text)
  41.         *(EXCLUDE_FILE (*.itcm*) .text.*)
  42.         *(.stub)
  43.         *(.gnu.warning)
  44.         *(.gnu.linkonce.t*)
  45.         *(.glue_7 .glue_7t)
  46.         . = ALIGN(4);
  47.     } >ewram
  48.    
  49.     .fini : {
  50.         KEEP (*(.fini))
  51.         . = ALIGN(4);
  52.     } >ewram
  53.    
  54.     __text_top__ = . ;
  55.     __data_bot__ = . ;
  56.    
  57.     .rodata : {
  58.         *all.rodata*(*)
  59.         *(.roda .rodata .rodata.*)
  60.         *(.gnu.linkonce.r*)
  61.         SORT(CONSTRUCTORS)
  62.         . = ALIGN(4);
  63.     } >ewram
  64.    
  65.     .ctors : {
  66.         KEEP (*crtbegin.o(.ctors))
  67.         KEEP (*(EXCLUDE_FILE (*crtend.o ) .ctors))
  68.         KEEP (*(SORT(.ctors.*)))
  69.         KEEP (*(.ctors))
  70.         . = ALIGN(4);
  71.     } >ewram
  72.    
  73.     .dtors : {
  74.         KEEP (*crtbegin.o(.dtors))
  75.         KEEP (*(EXCLUDE_FILE (*crtend.o ) .dtors))
  76.         KEEP (*(SORT(.dtors.*)))
  77.         KEEP (*(.dtors))
  78.         . = ALIGN(4);
  79.     } >ewram
  80.    
  81.     .eh_frame : {
  82.         KEEP (*(.eh_frame))
  83.         . = ALIGN(4);
  84.     } >ewram
  85.    
  86.     .gcc_except_table : {
  87.         KEEP (*(.gcc_except_table))
  88.         . = ALIGN(4);
  89.     } >ewram
  90.    
  91.     .jcr : {
  92.         KEEP (*(.jcr))
  93.         . = ALIGN(4);
  94.     } >ewram
  95.    
  96.     .got : {
  97.         *(.got.plt .rel.got .got)
  98.         . = ALIGN(4);
  99.     } >ewram
  100.    
  101.     .ewram : {
  102.         *(.ewram .ewram.*)
  103.         *ewram.*(.text)
  104.         . = ALIGN(4);
  105.     } >ewram
  106.    
  107.     .data : {
  108.         *(.data .data.*)
  109.         *(.gnu.linkonce.d*)
  110.         CONSTRUCTORS
  111.         . = ALIGN(4);
  112.     } >ewram
  113.    
  114.     __data_top__ = . ;
  115.    
  116.     __itcmlma__     = . ;
  117.     __itcmlma_bot__ = . ;
  118.     __itcmlma_top__ = . + SIZEOF(.itcm);
  119.     .itcm __itcm__ : AT(__itcmlma__) {
  120.         *(.itcm .itcm.*)
  121.         *itcm.*(.text)
  122.         . = ALIGN(4);
  123.     } >itcm
  124.    
  125.     __dtcmlma__     = __itcmlma__ + SIZEOF(.itcm);
  126.     __dtcmlma_bot__ = __itcmlma__ + SIZEOF(.itcm);
  127.     __dtcmlma_top__ = __itcmlma__ + SIZEOF(.itcm) + SIZEOF(.dtcm);
  128.     .dtcm __dtcm__ : AT(__dtcmlma__) {
  129.         *(.dtcm .dtcm.*)
  130.         . = ALIGN(4);
  131.     } >dtcm
  132.    
  133.     .sbss __dtcm_top__ (NOLOAD) : {
  134.         __sbss__     = . ;
  135.         __sbss_bot__ = . ;
  136.        
  137.         *(.dynsbss)
  138.         *(.sbss .sbss.*)
  139.         *(.scommon)
  140.         . = ALIGN(4);
  141.        
  142.         __sbss_top__ = . ;
  143.     } >dtcm
  144.    
  145.     .bss __data_top__ (NOLOAD) : {
  146.         __bss__     = . ;
  147.         __bss_bot__ = . ;
  148.        
  149.         *(.dynbss)
  150.         *(.bss .bss.*)
  151.         *(.gnu.linkonce.b*)
  152.         *(COMMON)
  153.         . = ALIGN(4);
  154.        
  155.         __bss_top__ = . ;
  156.         __end__     = . ;
  157.     } AT>ewram
  158. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement