freebsd-dev/lib/clang
Ed Maste 19703503ba lld: Omit PT_NOTE for SHT_NOTE without SHF_ALLOC
A non-alloc note section should not have a PT_NOTE program header.

Found while linking ghc (Haskell compiler) with lld on FreeBSD.  Haskell
emits a .debug-ghc-link-info note section (as the name suggests, it
contains link info) as a SHT_NOTE section without SHF_ALLOC set.

For this case ld.bfd does not emit a PT_NOTE segment for
.debug-ghc-link-info.  lld previously emitted a PT_NOTE with p_vaddr = 0
and FreeBSD's rtld segfaulted when trying to parse a note at address 0.

LLVM PR:	https://llvm.org/pr37361
LLVM review:	https://reviews.llvm.org/D46623

PR:		226872
Reviewed by:	dim
Sponsored by:	The FreeBSD Foundation
2018-05-09 11:17:01 +00:00
..
headers Merge llvm, clang, lld, lldb, compiler-rt and libc++ trunk r321545, 2017-12-29 00:56:15 +00:00
include lld: Omit PT_NOTE for SHT_NOTE without SHF_ALLOC 2018-05-09 11:17:01 +00:00
libclang Next step in updating llvm/clang build glue: make lldb build. 2017-12-22 19:10:19 +00:00
liblldb Build llvm-extract with -lz, and add a few objects to liblldb, both of 2018-01-13 13:53:05 +00:00
libllvm Recommit r332501, with an additional upstream fix for "Cannot lower 2018-04-20 18:20:55 +00:00
libllvmminimal First step in updating llvm/clang build glue: make only the clang 2017-12-21 21:24:52 +00:00
clang.build.mk Completely revamp the way llvm, clang and lldb are built. 2016-08-26 22:44:22 +00:00
clang.pre.mk Add forgotten {llvm,clang}.pre.mk files. 2016-08-26 22:56:23 +00:00
freebsd_cc_version.h Recommit r332501, with an additional upstream fix for "Cannot lower 2018-04-20 18:20:55 +00:00
lldb.pre.mk Centralize where LLVM_SRCS, CLANG_SRCS and LLDB_SRCS are defined. 2016-08-27 10:00:33 +00:00
llvm.build.mk Prefix {TARGET,BUILD}_TRIPLE with LLVM_ to avoid Makefile.inc1 collision. 2017-10-25 21:45:55 +00:00
llvm.pre.mk Use SRCTOP and OBJTOP throughout the llvm/clang/lldb build. 2016-08-27 09:29:39 +00:00
Makefile Completely revamp the way llvm, clang and lldb are built. 2016-08-26 22:44:22 +00:00
Makefile.inc Improve the coverage of debug symbols for MK_DEBUG_FILES. 2017-08-23 23:30:25 +00:00