public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
* [PATCH, BFD, AArch64] Define elf_backend_fixup_gnu_properties in AArch64
@ 2019-03-20 13:25 Sudakshina Das
  2019-03-20 15:00 ` Nick Clifton
  0 siblings, 1 reply; 3+ messages in thread
From: Sudakshina Das @ 2019-03-20 13:25 UTC (permalink / raw)
  To: binutils; +Cc: nd, nickc, Ramana Radhakrishnan, Richard Earnshaw

[-- Attachment #1: Type: text/plain, Size: 738 bytes --]

Hi

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" by moving the head of the list forward.

Builds and regression tested on aarch64-none-linux-gnu.

Is this ok for trunk?

Sudi

*** bfd/ChangeLog ***

2019-xx-xx  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.


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: rb10813.patch --]
[-- Type: text/x-patch; name="rb10813.patch", Size: 1786 bytes --]

diff --git a/bfd/elfxx-aarch64.h b/bfd/elfxx-aarch64.h
index a6d1792687cf39a68beb3235f5875d50bfc3ad4e..9ab13bb865bc3e31c35f6d00c83e074a72f0ff55 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
diff --git a/bfd/elfxx-aarch64.c b/bfd/elfxx-aarch64.c
index cae94d03e8453de0cceee1619668fff71a609edf..040814097f98071db09564392ed972e2e9f29692 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;
+	}
+    }
+}

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2019-03-20 18:03 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-03-20 13:25 [PATCH, BFD, AArch64] Define elf_backend_fixup_gnu_properties in AArch64 Sudakshina Das
2019-03-20 15:00 ` Nick Clifton
2019-03-20 18:03   ` Sudakshina Das

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).