• Austin Clements's avatar
    [dev.cc] liblink: don't patch jumps to jumps to symbols · e04c8b06
    Austin Clements authored
    When liblink sees something like
    
           JMP x
           ...
        x: JMP y
    
    it rewrites the first jump to jump directly to y.  This is
    fine if y is a resolved label.  However, it *also* does this
    if y is a function symbol, but fails to carry over the
    relocation that would later patch in that symbol's value.  As
    a result, the original jump becomes either a self-jump (if
    relative) or a jump to PC 0 (if absolute).
    
    Fix this by disabling this optimization if the jump being
    patched in is a jump to a symbol.
    
    LGTM=minux
    R=rsc, minux
    CC=golang-codereviews
    https://golang.org/cl/185890044
    e04c8b06
Name
Last commit
Last update
..
Makefile Loading commit data...
asm5.c Loading commit data...
asm6.c Loading commit data...
asm8.c Loading commit data...
asm9.c Loading commit data...
data.c Loading commit data...
go.c Loading commit data...
ld.c Loading commit data...
list5.c Loading commit data...
list6.c Loading commit data...
list8.c Loading commit data...
list9.c Loading commit data...
obj.c Loading commit data...
obj5.c Loading commit data...
obj6.c Loading commit data...
obj8.c Loading commit data...
obj9.c Loading commit data...
objfile.c Loading commit data...
pass.c Loading commit data...
pcln.c Loading commit data...
sched9.c Loading commit data...
sym.c Loading commit data...