Skip to content

Commit acde6c6

Browse files
[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.
1 parent 48869a5 commit acde6c6

File tree

3 files changed

+48
-0
lines changed

3 files changed

+48
-0
lines changed

bfd/ChangeLog

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
2019-03-20 Sudakshina Das <sudi.das@arm.com>
2+
3+
* elfxx-aarch64.c (_bfd_aarch64_elf_link_fixup_gnu_properties): Define.
4+
* elfxx-aarch64.h (_bfd_aarch64_elf_link_fixup_gnu_properties): Declare.
5+
(elf_backend_fixup_gnu_properties): Define for AArch64.
6+
17
2019-03-18 Alan Modra <amodra@gmail.com>
28

39
PR 24355

bfd/elfxx-aarch64.c

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -863,3 +863,38 @@ _bfd_aarch64_elf_merge_gnu_properties (struct bfd_link_info *info
863863

864864
return updated;
865865
}
866+
867+
/* Fix up AArch64 GNU properties. */
868+
void
869+
_bfd_aarch64_elf_link_fixup_gnu_properties
870+
(struct bfd_link_info *info ATTRIBUTE_UNUSED,
871+
elf_property_list **listp)
872+
{
873+
elf_property_list *p, *prev;
874+
875+
for (p = *listp, prev = *listp; p; p = p->next)
876+
{
877+
unsigned int type = p->property.pr_type;
878+
if (type == GNU_PROPERTY_AARCH64_FEATURE_1_AND)
879+
{
880+
if (p->property.pr_kind == property_remove)
881+
{
882+
/* Remove empty property. */
883+
if (prev == p)
884+
{
885+
*listp = p->next;
886+
prev = *listp;
887+
}
888+
else
889+
prev->next = p->next;
890+
continue;
891+
}
892+
prev = p;
893+
}
894+
else if (type > GNU_PROPERTY_HIPROC)
895+
{
896+
/* The property list is sorted in order of type. */
897+
break;
898+
}
899+
}
900+
}

bfd/elfxx-aarch64.h

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,5 +69,12 @@ _bfd_aarch64_elf_merge_gnu_properties (struct bfd_link_info *, bfd *,
6969
elf_property *, elf_property *,
7070
uint32_t);
7171

72+
extern void
73+
_bfd_aarch64_elf_link_fixup_gnu_properties (struct bfd_link_info *,
74+
elf_property_list **);
75+
7276
#define elf_backend_parse_gnu_properties \
7377
_bfd_aarch64_elf_parse_gnu_properties
78+
79+
#define elf_backend_fixup_gnu_properties \
80+
_bfd_aarch64_elf_link_fixup_gnu_properties

0 commit comments

Comments
 (0)