title: text relocations in shared objects?
body: <p>when I compile the following code (file named d.c) using gcc</p>
  
  <pre><code>int var=10;
  
  void fun( void ) {
    var++;
    int a=var;
  }
  </code></pre>
  
  <p>with </p>
  
  <pre><code>gcc -c -o d.o -fPIC d.c 
  </code></pre>
  
  <p>and call readelf -S there is a reloction section called .rela.text for the .text section</p>
  
  <p>if I link the file to a shared object (reloctest.so) with </p>
  
  <pre><code>gcc  -shared d.o -o reloctest.so 
  </code></pre>
  
  <p>the relocation section vanishes</p>
  
  <p>Is it guaranteed that there are no relocation for the .text segment in shared objects? I think yes (due to relocations were added for PLT and DYN) but I'm not sure</p>
  
  <p>Thanks for any answers</p>