• Keith Randall's avatar
    cmd/link: fix deferreturn detector · 9eb40315
    Keith Randall authored
    The logic for detecting deferreturn calls is wrong.
    
    We used to look for a relocation whose symbol is runtime.deferreturn
    and has an offset of 0. But on some architectures, the relocation
    offset is not zero. These include arm (the offset is 0xebfffffe) and
    s390x (the offset is 6).
    
    This ends up setting the deferreturn offset at 0, so we end up using
    the entry point live map instead of the deferreturn live map in a
    frame which defers and then segfaults.
    
    Instead, use the IsDirectCall helper to find calls.
    
    Fixes #32477
    Update #6980
    
    Change-Id: Iecb530a7cf6eabd7233be7d0731ffa78873f3a54
    Reviewed-on: https://go-review.googlesource.com/c/go/+/181258
    Run-TryBot: Keith Randall <khr@golang.org>
    TryBot-Result: Gobot Gobot <gobot@golang.org>
    Reviewed-by: default avatarCherry Zhang <cherryyz@google.com>
    9eb40315
pcln.go 14.9 KB