• Austin Clements's avatar
    cmd/cgo: accept weak dynamic imports · a2fb5cd8
    Austin Clements authored
    cgo produces dynamic imports for Go binaries by scanning the dynamic
    imports table of a binary produced by the system C compiler and
    linker. Currently, since it uses elf.File.ImportedSymbols, it only
    reads global symbols. Unfortunately, recent versions of lld emit weak
    symbol imports for several pthread symbols, which means the cgo tool
    doesn't emit dynamic imports for them, which ultimately causes linking
    of cgo binaries to fail.
    
    Fix this by using elf.File.DynamicSymbols instead and filtering down
    to both global and weak symbols.
    
    Fixes #31912.
    
    Change-Id: If346a7eca6733e3bfa2cccf74a9cda02a3e81d38
    Reviewed-on: https://go-review.googlesource.com/c/go/+/184100
    Run-TryBot: Austin Clements <austin@google.com>
    TryBot-Result: Gobot Gobot <gobot@golang.org>
    Reviewed-by: 's avatarIan Lance Taylor <iant@golang.org>
    a2fb5cd8
Name
Last commit
Last update
.github Loading commit data...
api Loading commit data...
doc Loading commit data...
lib/time Loading commit data...
misc Loading commit data...
src Loading commit data...
test Loading commit data...
.gitattributes Loading commit data...
.gitignore Loading commit data...
AUTHORS Loading commit data...
CONTRIBUTING.md Loading commit data...
CONTRIBUTORS Loading commit data...
LICENSE Loading commit data...
PATENTS Loading commit data...
README.md Loading commit data...
SECURITY.md Loading commit data...
favicon.ico Loading commit data...
robots.txt Loading commit data...