title: relocation R_X86_64_32S against `.text' can not be used when making a shared object
body: <p>I am compiling a static library, which leverages some inline assembly code.</p>
  
  <p>I notice that when I use labels for the <code>jmp</code> instruction:</p>
  
  <pre><code>int foo(){
  
   asm volatile
   (
      "mov    0x60(%r8),%r11d\n\t"
      "jmp    *S_401a70\n\t"
      ...
      "S_401a70: xor %rax, %rax\n\t"
      ...
   )
  }
  </code></pre>
  
  <p>and compile the code into a static library with the following flags:</p>
  
  <pre><code>-Wl,--no-undefined -nostdlib -nodefaultlibs -nostartfiles -L$(SOME_LIBRARY_PATH) \
  -Wl,--whole-archive -l$(SOME_Library_Name) -Wl,--no-whole-archive \
  -Wl,-Bstatic -Wl,-Bsymbolic -Wl,--no-undefined \
  -Wl,-pie,-eenclave_entry -Wl,--export-dynamic  \
  -Wl,--defsym,__ImageBase=0 
  </code></pre>
  
  <p>I would get some errors like:</p>
  
  <pre><code>/usr/bin/ld: Enclave/libtest.o: relocation R_X86_64_32S against `.text' can not be used when making a shared object; recompile with -fPIC
  </code></pre>
  
  <p>However, since I am compiling into a static library, I don't think <code>-fPIC</code> would make sense. I tried so, but it doesn't work at all.</p>
  
  <p>This seems like an issue with the <code>gcc assembly extension</code>, but I am not sure. Could anyone shed some lights on this? Thank you!</p>