title: How to direct gas use a specified encoding form of instructions, for example, MOV?
body: <p>The MOV have the two form to move an imm to r64:</p>
  
  <pre><code>| Opcode         | Instruction     | Op/En | 64-Bit Mode | Compat/Leg Mode | Description                                   |
  | REX.W + B8+ rd | MOV r64, imm64  | E     | Valid       | N.E.            | Move imm64 to r64.                            |
  | REX.W + C7 /0  | MOV r/m64,imm32 | F     | Valid       | N.E.            | Move imm32 sign extended to 64-bits to r/m64. |
  </code></pre>
  
  <p>In the example bellow, Line 6(Line 5,7 are not so important, we ignore it.) use the 2nd form.
      So the problem is, if we link the object file with '-Ttext=' to specify a address 
      that can be fit in 32bits, e.g. 'ld m.o -Ttext=0x1234' it works well.
      but if we use an addres wider than 32bits, e.g. 'ld m.o -Ttext=0x1234567887',
      it does not works.</p>
  
  <p>If Line 6 is encoded in the 1st form, i think the two link command above will both work well. </p>
  
  <p><strong>So how to direct the gas encode the Line 6 in the 1st form?</strong></p>
  
  <pre><code> 1
   2  .code64
   3  .global _start
   4  _start:
   5      movq $1, %rdi
   6      movq $str, %rsi
   7      movq $len, %rdx
   8      movl $1, %eax
   9      syscall
  10      movq $0, %rdi
  11      movl $60, %eax
  12      syscall
  13  str: .asciz "hello write\n"
  14  .equ len, . - str
  
  # as m.s -o m.o
  # ld m.o -Ttext=0x1234
  
  0000000000001234 &lt;_start&gt;:
  1234:       48 c7 c7 01 00 00 00    mov    $0x1,%rdi
  123b:       48 c7 c6 5e 12 00 00    mov    $0x125e,%rsi
  1242:       48 c7 c2 0d 00 00 00    mov    $0xd,%rdx
  1249:       b8 01 00 00 00          mov    $0x1,%eax
  124e:       0f 05                   syscall
  1250:       48 c7 c7 00 00 00 00    mov    $0x0,%rdi
  1257:       b8 3c 00 00 00          mov    $0x3c,%eax
  125c:       0f 05                   syscall
  
  # ld m.o -Ttext=0x1234567887
  m.o: In function `_start':
  (.text+0xa): relocation truncated to fit: R_X86_64_32S against `.text'
  </code></pre>
  
  <p><em><strong>Edit:</em></strong></p>
  
  <p>I got it. I write a funciton like</p>
  
  <pre><code>long aaa(void)
  {
      return 0x1234567890l;
  }
  </code></pre>
  
  <p>and the gcc generate following asm code</p>
  
  <pre><code>movabsq $78187493520, %rax
  </code></pre>
  
  <p>to return the value. My example works int this way now.</p>
  
  <p>But I don't find any thing about 'movabsq' in 'ingo gas'. Somebody tell me where to get the help? Thanks!</p>