Sync DF_1_* flag definitions with llvm 13, including support in
authorguenther <guenther@openbsd.org>
Sat, 25 Dec 2021 01:25:51 +0000 (01:25 +0000)
committerguenther <guenther@openbsd.org>
Sat, 25 Dec 2021 01:25:51 +0000 (01:25 +0000)
readelf -d for displaying them.
(lld 13 sets DF_1_PIE on most our binaries)

ok jsg@

gnu/usr.bin/binutils-2.17/binutils/readelf.c
gnu/usr.bin/binutils-2.17/include/elf/common.h
sys/sys/exec_elf.h

index df2bd1b..716b276 100644 (file)
@@ -6425,6 +6425,71 @@ process_dynamic_section (FILE *file)
                      printf (" CONLFAT");
                      val ^= DF_1_CONLFAT;
                    }
+                 if (val & DF_1_ENDFILTEE)
+                   {
+                     printf (" ENDFILTEE");
+                     val ^= DF_1_ENDFILTEE;
+                   }
+                 if (val & DF_1_DISPRELDNE)
+                   {
+                     printf (" DISPRELDNE");
+                     val ^= DF_1_DISPRELDNE;
+                   }
+                 if (val & DF_1_DISPRELPND)
+                   {
+                     printf (" DISPRELPND");
+                     val ^= DF_1_DISPRELPND;
+                   }
+                 if (val & DF_1_NODIRECT)
+                   {
+                     printf (" NODIRECT");
+                     val ^= DF_1_NODIRECT;
+                   }
+                 if (val & DF_1_IGNMULDEF)
+                   {
+                     printf (" IGNMULDEF");
+                     val ^= DF_1_IGNMULDEF;
+                   }
+                 if (val & DF_1_NOKSYMS)
+                   {
+                     printf (" NOKSYMS");
+                     val ^= DF_1_NOKSYMS;
+                   }
+                 if (val & DF_1_NOHDR)
+                   {
+                     printf (" NOHDR");
+                     val ^= DF_1_NOHDR;
+                   }
+                 if (val & DF_1_EDITED)
+                   {
+                     printf (" EDITED");
+                     val ^= DF_1_EDITED;
+                   }
+                 if (val & DF_1_NORELOC)
+                   {
+                     printf (" NORELOC");
+                     val ^= DF_1_NORELOC;
+                   }
+                 if (val & DF_1_SYMINTPOSE)
+                   {
+                     printf (" SYMINTPOSE");
+                     val ^= DF_1_SYMINTPOSE;
+                   }
+                 if (val & DF_1_GLOBAUDIT)
+                   {
+                     printf (" GLOBAUDIT");
+                     val ^= DF_1_GLOBAUDIT;
+                   }
+                 if (val & DF_1_SINGLETON)
+                   {
+                     printf (" SINGLETON");
+                     val ^= DF_1_SINGLETON;
+                   }
+                 if (val & DF_1_PIE)
+                   {
+                     printf (" PIE");
+                     val ^= DF_1_PIE;
+                   }
                  if (val != 0)
                    printf (" %lx", val);
                  puts ("");
index 4ac70f7..1e535ef 100644 (file)
 #define DF_1_NODEFLIB  0x00000800
 #define DF_1_NODUMP    0x00001000
 #define DF_1_CONLFAT   0x00002000
+#define DF_1_ENDFILTEE 0x00004000
+#define DF_1_DISPRELDNE        0x00008000
+#define DF_1_DISPRELPND        0x00010000
+#define DF_1_NODIRECT  0x00020000
+#define DF_1_IGNMULDEF 0x00040000
+#define DF_1_NOKSYMS   0x00080000
+#define DF_1_NOHDR     0x00100000
+#define DF_1_EDITED    0x00200000
+#define DF_1_NORELOC   0x00400000
+#define DF_1_SYMINTPOSE        0x00800000
+#define DF_1_GLOBAUDIT 0x01000000
+#define DF_1_SINGLETON 0x02000000
+#define DF_1_PIE       0x08000000
 
 /* Flag values for the DT_FLAGS entry. */
 #define DF_ORIGIN      (1 << 0)
index 9f7f397..8083ae3 100644 (file)
@@ -1,4 +1,4 @@
-/*     $OpenBSD: exec_elf.h,v 1.93 2021/12/07 22:17:03 guenther Exp $  */
+/*     $OpenBSD: exec_elf.h,v 1.94 2021/12/25 01:25:51 guenther Exp $  */
 /*
  * Copyright (c) 1995, 1996 Erik Theisen.  All rights reserved.
  *
@@ -576,6 +576,19 @@ typedef struct {
 #define DF_1_NODEFLIB  0x00000800
 #define DF_1_NODUMP    0x00001000
 #define DF_1_CONLFAT   0x00002000
+#define DF_1_ENDFILTEE 0x00004000
+#define DF_1_DISPRELDNE        0x00008000
+#define DF_1_DISPRELPND        0x00010000
+#define DF_1_NODIRECT  0x00020000
+#define DF_1_IGNMULDEF 0x00040000
+#define DF_1_NOKSYMS   0x00080000
+#define DF_1_NOHDR     0x00100000
+#define DF_1_EDITED    0x00200000
+#define DF_1_NORELOC   0x00400000
+#define DF_1_SYMINTPOSE        0x00800000
+#define DF_1_GLOBAUDIT 0x01000000
+#define DF_1_SINGLETON 0x02000000
+#define DF_1_PIE       0x08000000
 
 /*
  * Note header