title: Position independent addressing in GNU assembler with Intel syntax
body: <p>On x86-64, how do I load an address from the .data section in a position independent manner (PIC and PIE compatible) when using the GNU assembler with <em>intel syntax</em>. </p>
  
  <p>For example, using AT&amp;T syntax, you can do this:</p>
  
  <pre><code>leaq mystring(%rip), %rdi
  </code></pre>
  
  <p>Is there an equivalent for Intel syntax? I can't seem to find the answer using search engines...</p>
  
  <p>I am actually using the <code>noprefix</code> version of intel syntax, in case that makes a difference.</p>
  
  <p>Thanks</p>