Bug 231882

Summary: multiple toolchain issues with statically linked binaries
Product: Base System Reporter: Ed Maste <emaste>
Component: binAssignee: freebsd-bugs (Nobody) <bugs>
Status: New ---    
Severity: Affects Only Me CC: cem
Priority: ---    
Version: CURRENT   
Hardware: Any   
OS: Any   
Bug Depends on: 236165, 232176, 233336    
Bug Blocks: 231027    

Description Ed Maste freebsd_committer freebsd_triage 2018-10-02 18:09:09 UTC
Attempting to make use of some WIP with statically linked binaries (i386 / amd64) has uncovered a number of tool chain issues which will be tracked in this PR.

* elfcopy/strip removes ifunc, probably other relocations

Found by kib@, with userland ifunc stripped statically linked binaries segfault. strip removed the .rela.plt section header; file content at the expected relocation site has been zeroed.

See LLVM PR 37538 for an initial part of this issue - lld is writing 0 in sh_info and sh_link on the .rela.plt section. https://bugs.llvm.org/show_bug.cgi?id=37538

This likely also affects static PIE.
Comment 1 Ed Maste freebsd_committer freebsd_triage 2018-10-02 23:03:00 UTC
Another llvm PR that may be related: https://bugs.llvm.org/show_bug.cgi?id=38074
Comment 2 Ed Maste freebsd_committer freebsd_triage 2018-10-11 13:22:09 UTC
lld issue fixed in r339304