title: Placing a global constant array into `.rodata` section
body: <p>The goal is to place a large array of constant data into <code>.rodata</code> section with allowing the access to it from other translation units. As far as I know, GCC would place a data into the read-only section if declared as <code>static const</code>. But then it is impossible to declare it as <code>extern</code> in other files. For a non-static array I would do something like:
  <code>data.c</code> will contain:</p>
  
  <pre><code>const int data[] = {0,1,2,....}
  </code></pre>
  
  <p>and <code>data.h</code> will contain:</p>
  
  <pre><code>extern const int data[];
  </code></pre>
  
  <p>It will allow any file including <code>data.h</code> to "see" this data. But how would one do about this:</p>
  
  <pre><code>static const int data[] = {0,1,2,....}
  </code></pre>
  
  <p>Of course, I can define the target section explicitly, using <code>__attribute __((section("name"))</code>, but I prefer to avoid this type of heavy artillery usage.
  So what is the most portable and appropriate way of doing the required?</p>