This is the mail archive of the binutils@sourceware.org mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] DT_FLAGS_1: Add Solaris bits


On Tue, Mar 20, 2018 at 10:03 AM, H.J. Lu <hongjiu.lu@intel.com> wrote:
> The following bits in DT_FLAGS_1 are used by Solaris:
>
>  #define DF_1_KMOD       0x10000000 /* kernel module */
>  #define DF_1_WEAKFILTER 0x20000000 /* apply weak binding to DT_FILTER */
>  #define DF_1_NOCOMMON   0x40000000 /* no COMMON symbols exist */
>
> OK for master?
>
> H.J.
> ---
>         * elf/common.h (DF_1_KMOD): New.
>         (DF_1_WEAKFILTER): Likewise.
>         (DF_1_NOCOMMON): Likewise.

The updated patch to dump these bits.

-- 
H.J.
From bffd04b4c9c0164a7a9137fd2a3eef9e45094e3c Mon Sep 17 00:00:00 2001
From: "H.J. Lu" <hjl.tools@gmail.com>
Date: Tue, 20 Mar 2018 09:59:14 -0700
Subject: [PATCH] DT_FLAGS_1: Add Solaris bits

The following bits in DT_FLAGS_1 are used by Solaris:

 #define DF_1_KMOD       0x10000000 /* kernel module */
 #define DF_1_WEAKFILTER 0x20000000 /* apply weak binding to DT_FILTER */
 #define DF_1_NOCOMMON   0x40000000 /* no COMMON symbols exist */

binutils/

	* readelf.c (process_dynamic_section): Also dump DF_1_KMOD,
	DF_1_WEAKFILTER and DF_1_NOCOMMON.

include/

	* elf/common.h (DF_1_KMOD): New.
	(DF_1_WEAKFILTER): Likewise.
	(DF_1_NOCOMMON): Likewise.
---
 binutils/readelf.c   | 15 +++++++++++++++
 include/elf/common.h |  3 +++
 2 files changed, 18 insertions(+)

diff --git a/binutils/readelf.c b/binutils/readelf.c
index b85db9f97c..d0bd679032 100644
--- a/binutils/readelf.c
+++ b/binutils/readelf.c
@@ -10009,6 +10009,21 @@ process_dynamic_section (Filedata * filedata)
 		      printf (" PIE");
 		      val ^= DF_1_PIE;
 		    }
+		  if (val & DF_1_KMOD)
+		    {
+		      printf (" KMOD");
+		      val ^= DF_1_KMOD;
+		    }
+		  if (val & DF_1_WEAKFILTER)
+		    {
+		      printf (" WEAKFILTER");
+		      val ^= DF_1_WEAKFILTER;
+		    }
+		  if (val & DF_1_NOCOMMON)
+		    {
+		      printf (" NOCOMMON");
+		      val ^= DF_1_NOCOMMON;
+		    }
 		  if (val != 0)
 		    printf (" %lx", val);
 		  puts ("");
diff --git a/include/elf/common.h b/include/elf/common.h
index 61a1ca7c1e..f4354721bf 100644
--- a/include/elf/common.h
+++ b/include/elf/common.h
@@ -1006,6 +1006,9 @@
 #define	DF_1_SINGLETON	0x02000000
 #define	DF_1_STUB	0x04000000
 #define	DF_1_PIE	0x08000000
+#define	DF_1_KMOD	0x10000000
+#define	DF_1_WEAKFILTER	0x20000000
+#define	DF_1_NOCOMMON	0x40000000
 
 /* Flag values for the DT_FLAGS entry.	*/
 #define DF_ORIGIN	(1 << 0)
-- 
2.14.3


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]