emaste 2149cb08d1 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
..
2018-04-14 21:54:22 +00:00
2018-03-02 01:53:50 +00:00
2017-05-31 19:37:23 +00:00
2017-09-17 19:14:38 +00:00
2018-02-19 05:10:22 +00:00
2018-01-24 14:24:17 +00:00
2017-07-03 19:49:25 +00:00
2017-08-03 15:47:42 +00:00
2018-03-02 23:31:55 +00:00
2018-02-28 07:59:55 +00:00
2017-05-23 09:29:05 +00:00
2017-05-05 13:31:25 +00:00
2018-01-28 03:16:54 +00:00
2017-06-28 09:22:45 +00:00
2018-05-08 04:52:52 +00:00
2017-12-06 02:21:11 +00:00
2017-03-25 14:14:11 +00:00
2018-04-18 13:17:14 +00:00
2018-05-04 10:17:27 +00:00
2017-06-03 18:21:50 +00:00
2017-09-10 01:25:15 +00:00