• Gustavo Niemeyer's avatar
    6l: Relocate CMOV* instructions · 1a472026
    Gustavo Niemeyer authored
    The linker avoids a GOT indirection by turning a MOV into
    a LEA, but with x86-64 GCC has started emitting CMOV*
    instructions which break the existing logic.
    
    This will generate errors such as:
    
      unexpected GOT reloc for non-dynamic symbol luaO_nilobject_
    
    The CMOV* instructions may be emitted with normal code like:
    
      if (o >= L->top) return cast(TValue *, luaO_nilobject);
      else return o;
    
    Which gets compiled into (relocation offset at 1b):
    
      13: 48 3b 47 10             cmp    0x10(%rdi),%rax
      17: 48 0f 43 05 00 00 00    cmovae 0x0(%rip),%rax
      1e: 00
    
    This change will allow the indirection through the GOT to
    avoid the problem in those cases.
    
    R=golang-dev, rsc
    CC=golang-dev
    https://golang.org/cl/4071044
    1a472026
Name
Last commit
Last update
..
6.out.h Loading commit data...
Makefile Loading commit data...
asm.c Loading commit data...
doc.go Loading commit data...
l.h Loading commit data...
list.c Loading commit data...
mkenam Loading commit data...
obj.c Loading commit data...
optab.c Loading commit data...
pass.c Loading commit data...
prof.c Loading commit data...
span.c Loading commit data...