[PATCH] D15494: [ELF] - implemented @indntpoff (x86) relocation and its optimization.

Sean Silva via llvm-commits llvm-commits at lists.llvm.org
Mon Dec 14 16:22:02 PST 2015


silvas added a subscriber: silvas.

================
Comment at: ELF/Target.cpp:519-520
@@ +518,4 @@
+    // For R_386_TLS_IE relocation we perform the next transformations:
+    // MOVL foo at INDNTPOFF,%EAX is transformed to MOVL $foo,%EAX
+    // MOVL foo at INDNTPOFF,%REG is transformed to MOVL $foo,%REG
+    // ADDL foo at INDNTPOFF,%REG is transformed to ADDL $foo,%REG
----------------
ruiu wrote:
> Isn't the former a special case of the latter? (EAX is a REG?)
There is a special encoding for the EAX version, so from a linker's perspective (operations on machine code bytes) they are different. There are many x86 instructions for which eax is special (carry-over from old 8086 CISC stuff). Originally, ax = "accumulator" register and had a special "load accumulator" instruction which now is a special encoding pattern-matched by the assembler for assembly text `mov $foo,%eax`. Another example is use of cx "count" register as arg for variable bit shift.


http://reviews.llvm.org/D15494





More information about the llvm-commits mailing list