• Russ Cox's avatar
    [dev.cc] liblink: resolve bss vs other conflict regardless of order found · 0185ba76
    Russ Cox authored
    If the linker finds the same name given a BSS and a non-BSS
    symbol, the assumption is that the non-BSS symbol is the
    true one, and the BSS symbol is just the best Go can do toward
    an "extern" declaration. This has always been the case,
    as long as the object files were read in the right order.
    
    The old code worked when the BSS symbol is found before
    the non-BSS symbol. This CL adds equivalent logic for when
    the non-BSS symbol is found before the BSS symbol.
    This comes up when Go must refer to symbols defined in
    host object files.
    
    LGTM=r
    R=r
    CC=austin, golang-codereviews, iant, khr
    https://golang.org/cl/171480043
    0185ba76
objfile.c 19.4 KB