title: #pragma for GNU ARM
body: <p>I want to enclose an entire C file in a output section,</p>
  
  <p>Here is the example code I am trying:</p>
  
  <pre><code>#include&lt;stdio.h&gt;
  #pragma arm section code = ".sec_ro"
  int main(void)
  {
  printf("Hi\n");
  }
  #pragma arm section
  </code></pre>
  
  <p>I used :</p>
  
  <pre><code>arm-none-linux-gnueabi-gcc -S hello.c
  </code></pre>
  
  <p>to get the .S file.</p>
  
  <p>But it looks like the <code>sec_ro</code> section is not present in the .S file.</p>
  
  <p><strong>EDIT/UPDATE</strong> :</p>
  
  <p>Attaching the .s file contents :</p>
  
  <pre><code>.arch armv5te
  .fpu softvfp
  .eabi_attribute 20, 1
  .eabi_attribute 21, 1
  .eabi_attribute 23, 3
  .eabi_attribute 24, 1
  .eabi_attribute 25, 1
  .eabi_attribute 26, 2
  .eabi_attribute 30, 6
  .eabi_attribute 18, 4
  .file   "hello.c"
  .section    .rodata
  .align  2
  .LC0:
      .ascii  "Hi\000"
      .text
      .align  2
      .global main
      .type   main, %function
  main:
      .fnstart
  .LFB0:
      @ args = 0, pretend = 0, frame = 0
      @ frame_needed = 1, uses_anonymous_args = 0
      stmfd   sp!, {fp, lr}
      .save {fp, lr}
      .setfp fp, sp, #4
      add fp, sp, #4
      ldr r0, .L2
      bl  puts
      mov r0, r3
      ldmfd   sp!, {fp, pc}
  </code></pre>
  
  <p>I want to enclose an entire C file to create an output section , I am using GNU ARM tool chain, Am I missing something ?</p>