title: What are assembler section directives used for?
body: <p>I'm trying to learn ARM assembly.</p>
  
  <p>After writing this small Hello World program:</p>
  
  <pre><code>                .global _start
  
                  .text
  _start:         ldr     R1,=msgtxt      
                  mov     R2,#13          
                  mov     R0,#1           
                  mov     R7,#4           
                  svc     0               
  
                  mov     R7,#1           
                  svc     0               
  
  
                  .data
  msgtxt:         .ascii  "Hello World!\n"
  
                  .end
  </code></pre>
  
  <p>I noticed I could remove the .text and .data directive, the program would work just as well.</p>
  
  <p>I'm therefore curious : everything I read emphasized the fact that .text section is to be used for code and .data for data. But here, before my eyes, they seem to do nothing at all!</p>
  
  <p>Therefore, if these are not used to hold code and data respectively, what is their true purpose?</p>