[binutils-gdb] Handle DT_GNU_FLAGS_1 in readelf

Alan Modra amodra@sourceware.org
Tue Dec 15 08:16:05 GMT 2020


https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=a5da3dee21c1c2f52c1e9f5c0e5ed82fce5bb429

commit a5da3dee21c1c2f52c1e9f5c0e5ed82fce5bb429
Author: Vivek Das Mohapatra <vivek@collabora.com>
Date:   Mon Dec 14 17:25:53 2020 +0000

    Handle DT_GNU_FLAGS_1 in readelf
    
            * readelf.c (get_dynamic_type): Handle DT_GNU_FLAGS_1.
            (process_dynamic_section): Likewise.

Diff:
---
 binutils/ChangeLog |  5 +++++
 binutils/readelf.c | 23 +++++++++++++++++++++++
 2 files changed, 28 insertions(+)

diff --git a/binutils/ChangeLog b/binutils/ChangeLog
index 6f0ed5e1621..885b4703484 100644
--- a/binutils/ChangeLog
+++ b/binutils/ChangeLog
@@ -1,3 +1,8 @@
+2020-12-15  Vivek Das Mohapatra  <vivek@collabora.com>
+
+	* readelf.c (get_dynamic_type): Handle DT_GNU_FLAGS_1.
+	(process_dynamic_section): Likewise.
+
 2020-12-11  Cary Coutant  <ccoutant@gmail.com>
 
 	* readelf.c (get_machine_name): Update list of e_machine values.
diff --git a/binutils/readelf.c b/binutils/readelf.c
index ed252f9c414..22354ba951b 100644
--- a/binutils/readelf.c
+++ b/binutils/readelf.c
@@ -2232,6 +2232,7 @@ get_dynamic_type (Filedata * filedata, unsigned long type)
     case DT_GNU_LIBLIST: return "GNU_LIBLIST";
     case DT_GNU_LIBLISTSZ: return "GNU_LIBLISTSZ";
     case DT_GNU_HASH:	return "GNU_HASH";
+    case DT_GNU_FLAGS_1: return "GNU_FLAGS_1";
 
     default:
       if ((type >= DT_LOPROC) && (type <= DT_HIPROC))
@@ -11082,6 +11083,28 @@ the .dynstr section doesn't match the DT_STRTAB and DT_STRSZ tags\n"));
 	    }
 	  break;
 
+	case DT_GNU_FLAGS_1:
+	  if (do_dynamic)
+	    {
+	      printf (_("Flags:"));
+	      if (entry->d_un.d_val == 0)
+		printf (_(" None\n"));
+	      else
+		{
+		  unsigned long int val = entry->d_un.d_val;
+
+		  if (val & DF_GNU_1_UNIQUE)
+		    {
+		      printf (" UNIQUE");
+		      val ^= DF_GNU_1_UNIQUE;
+		    }
+		  if (val != 0)
+		    printf (" %lx", val);
+		  puts ("");
+		}
+	    }
+	  break;
+
 	default:
 	  if ((entry->d_tag >= DT_VERSYM) && (entry->d_tag <= DT_VERNEEDNUM))
 	    filedata->version_info[DT_VERSIONTAGIDX (entry->d_tag)]


More information about the Binutils-cvs mailing list