object, and ignore the mode bits.
#include "file.h"
#ifndef lint
-FILE_RCSID("@(#)$File: readelf.c,v 1.158 2019/01/22 16:28:42 christos Exp $")
+FILE_RCSID("@(#)$File: readelf.c,v 1.159 2019/02/01 17:58:48 christos Exp $")
#endif
#ifdef BUILTIN_ELF
switch (xdh_tag) {
case DT_FLAGS_1:
- if (xdh_val == DF_1_PIE)
+ if (xdh_val & DF_1_PIE)
ms->mode |= 0111;
else
ms->mode &= ~0111;
switch (xph_type) {
case PT_DYNAMIC:
offset = 0;
+ // Let DF_1 determine if we are PIE or not.
+ ms->mode &= ~0111;
for (;;) {
if (offset >= (size_t)bufsize)
break;