This is the mail archive of the binutils-cvs@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]

[binutils-gdb] [BFD, AArch64] Define elf_backend_fixup_gnu_properties in AArch64


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

commit acde6c6b431a8c38ab18a47bb56f65f515448195
Author: Sudakshina Das <sudi.das@arm.com>
Date:   Wed Mar 20 18:00:07 2019 +0000

    [BFD, AArch64] Define elf_backend_fixup_gnu_properties in AArch64
    
    This patch add support for elf_backend_fixup_gnu_properties for GNU
    property support for AArch64. The new AArch64 specific definition
    _bfd_aarch64_elf_link_fixup_gnu_properties goes through the property
    list to find AArch64 type properties and removes the properties that
    are marked as "property_remove".
    
    *** bfd/ChangeLog ***
    
    2019-03-20  Sudakshina Das  <sudi.das@arm.com>
    
    	* elfxx-aarch64.c (_bfd_aarch64_elf_link_fixup_gnu_properties): Define.
    	* elfxx-aarch64.h (_bfd_aarch64_elf_link_fixup_gnu_properties): Declare.
    	(elf_backend_fixup_gnu_properties): Define for AArch64.

Diff:
---
 bfd/ChangeLog       |  6 ++++++
 bfd/elfxx-aarch64.c | 35 +++++++++++++++++++++++++++++++++++
 bfd/elfxx-aarch64.h |  7 +++++++
 3 files changed, 48 insertions(+)

diff --git a/bfd/ChangeLog b/bfd/ChangeLog
index 9cdd4fe..d0daa37 100644
--- a/bfd/ChangeLog
+++ b/bfd/ChangeLog
@@ -1,3 +1,9 @@
+2019-03-20  Sudakshina Das  <sudi.das@arm.com>
+
+	* elfxx-aarch64.c (_bfd_aarch64_elf_link_fixup_gnu_properties): Define.
+	* elfxx-aarch64.h (_bfd_aarch64_elf_link_fixup_gnu_properties): Declare.
+	(elf_backend_fixup_gnu_properties): Define for AArch64.
+
 2019-03-18  Alan Modra  <amodra@gmail.com>
 
 	PR 24355
diff --git a/bfd/elfxx-aarch64.c b/bfd/elfxx-aarch64.c
index cae94d0..0408140 100644
--- a/bfd/elfxx-aarch64.c
+++ b/bfd/elfxx-aarch64.c
@@ -863,3 +863,38 @@ _bfd_aarch64_elf_merge_gnu_properties (struct bfd_link_info *info
 
   return updated;
 }
+
+/* Fix up AArch64 GNU properties.  */
+void
+_bfd_aarch64_elf_link_fixup_gnu_properties
+  (struct bfd_link_info *info ATTRIBUTE_UNUSED,
+   elf_property_list **listp)
+{
+  elf_property_list *p, *prev;
+
+  for (p = *listp, prev = *listp; p; p = p->next)
+    {
+      unsigned int type = p->property.pr_type;
+      if (type == GNU_PROPERTY_AARCH64_FEATURE_1_AND)
+	{
+	  if (p->property.pr_kind == property_remove)
+	    {
+	      /* Remove empty property.  */
+	      if (prev == p)
+		{
+		  *listp = p->next;
+		  prev = *listp;
+		}
+	      else
+		  prev->next = p->next;
+	      continue;
+	    }
+	  prev = p;
+	}
+      else if (type > GNU_PROPERTY_HIPROC)
+	{
+	  /* The property list is sorted in order of type.  */
+	  break;
+	}
+    }
+}
diff --git a/bfd/elfxx-aarch64.h b/bfd/elfxx-aarch64.h
index a6d1792..9ab13bb 100644
--- a/bfd/elfxx-aarch64.h
+++ b/bfd/elfxx-aarch64.h
@@ -69,5 +69,12 @@ _bfd_aarch64_elf_merge_gnu_properties (struct bfd_link_info *, bfd *,
 				       elf_property *, elf_property *,
 				       uint32_t);
 
+extern void
+_bfd_aarch64_elf_link_fixup_gnu_properties (struct bfd_link_info *,
+					    elf_property_list **);
+
 #define elf_backend_parse_gnu_properties	\
   _bfd_aarch64_elf_parse_gnu_properties
+
+#define elf_backend_fixup_gnu_properties	\
+  _bfd_aarch64_elf_link_fixup_gnu_properties


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