Konstantin Belousov 2b5d88fdcf Fix ldd for PIE binaries after rtld stopped accepting binaries for dlopen.
ldd proclaims ET_DYN objects as shared libraries and tries to
dlopen(RTLD_TRACE) them to get dependencies. Since PIE binaries are
ET_DYN | DF_1_PIE, refusal to dlopen such binaries breaks ldd.

Fix it by reading and parsing dynamic segment looking for DF_FLAG_1
and taking DF_1_PIE into account when deciding between binary and
library.

Reported by:	Dewayne Geraghty <dewayne@heuristicsystems.com.au>
Reviewed by:	markj
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D25257
2020-06-13 18:21:31 +00:00
..
2017-10-31 00:07:04 +00:00
2020-06-13 09:16:07 +00:00
2019-01-12 12:35:02 +00:00
2020-06-09 20:52:35 +00:00
2019-12-11 17:37:53 +00:00
2020-05-20 20:58:48 +00:00
2017-10-31 00:07:04 +00:00
2019-12-11 17:37:53 +00:00
2019-12-11 17:37:53 +00:00
2020-05-20 20:58:48 +00:00
2020-06-01 09:15:15 +00:00
2019-07-19 15:10:53 +00:00
2017-10-31 00:07:04 +00:00
2017-10-31 00:07:04 +00:00
2018-04-25 18:56:27 +00:00
2017-10-31 00:07:04 +00:00
2017-12-01 21:44:23 +00:00
2019-10-28 21:48:20 +00:00
2017-10-31 00:07:04 +00:00
2019-12-07 20:01:55 +00:00
2019-04-22 17:52:46 +00:00
2019-12-11 17:37:53 +00:00
2020-03-14 05:57:22 +00:00
2019-12-11 17:37:53 +00:00
2017-10-31 00:07:04 +00:00
2020-05-21 17:34:31 +00:00
2018-03-02 23:31:55 +00:00
2020-02-19 14:55:59 +00:00
2020-06-05 16:59:14 +00:00
2019-08-25 01:05:01 +00:00
2019-11-12 22:31:59 +00:00
2019-06-29 18:41:40 +00:00
2020-03-29 19:16:14 +00:00
2017-10-31 00:07:04 +00:00
2019-09-09 15:37:40 +00:00
2018-11-04 16:58:55 +00:00
2020-06-08 21:11:34 +00:00
2018-01-06 15:52:28 +00:00
2019-12-11 17:37:53 +00:00
2018-11-20 00:06:53 +00:00
2019-12-11 17:37:53 +00:00
2018-07-03 19:09:46 +00:00
2018-06-25 11:44:56 +00:00
2019-12-11 17:37:53 +00:00
2019-12-11 17:37:53 +00:00
2019-05-01 19:35:45 +00:00
2019-12-11 17:37:53 +00:00
2020-03-26 17:58:52 +00:00
2020-05-20 20:58:48 +00:00
2017-12-28 05:33:39 +00:00
2019-12-11 17:37:53 +00:00
2018-05-04 14:39:32 +00:00
2018-03-29 02:13:58 +00:00
2020-04-03 14:47:40 +00:00
2018-07-29 07:51:42 +00:00
2019-11-20 19:43:34 +00:00
2017-10-31 00:07:04 +00:00
2018-11-12 07:14:34 +00:00
2019-07-19 20:04:31 +00:00
2017-10-31 00:07:04 +00:00
2019-08-23 16:03:23 +00:00
2020-06-11 15:14:39 +00:00
2020-01-25 21:16:45 +00:00
2017-06-16 06:29:21 +00:00
2017-06-16 06:29:21 +00:00
2017-10-31 00:07:04 +00:00
2017-10-31 00:07:04 +00:00
2017-10-31 00:07:04 +00:00
2019-04-19 02:54:13 +00:00
2020-03-23 19:01:23 +00:00