The following is rejected by gas: .intel_syntax noprefix mov rax, QWORD PTR __CTOR_END__-8[rip] These equivalent instructions are accepted by gas as expected: mov rax, QWORD PTR __CTOR_END__+-8[rip] mov rax, QWORD PTR -8+__CTOR_END__[rip] mov rax, QWORD PTR __CTOR_END__[rip-8] Ofcourse the variant that gas rejects is the one which GCC emits. :-(
Fixed by http://sourceware.org/ml/binutils/2007-09/msg00202.html
According to http://sourceware.org/ml/binutils/2007-09/msg00213.html it is invalid MASM assembly code. The fix has been reverted.
There's a bug in GCC with %rip relative adressing and -masm=intel. I'm fixing that, which means GCC will output one of the supported address forms, just as with any other register: mov rax, QWORD PTR __CTOR_END__[rip-8] So I'm closing this bug as invalid.