This allows an early return if we find a higher numbered tag. */
obj_attr_v2_t *
-_bfd_obj_attr_v2_find_by_tag (const obj_attr_subsection_v2_t *subsec,
+bfd_obj_attr_v2_find_by_tag (const obj_attr_subsection_v2_t *subsec,
obj_attr_tag_t tag,
bool sorted)
{
LINKED_LIST_MERGE_SORT_DECL (obj_attr_subsection_v2_t,
obj_attr_v2_t, /* extern */)
+/* Public API wrapper for LINKED_LIST_APPEND (obj_attr_v2_t). */
+
+void bfd_obj_attr_subsection_v2_append (obj_attr_subsection_v2_t *subsec,
+ obj_attr_v2_t *attr)
+{
+ LINKED_LIST_APPEND (obj_attr_v2_t) (subsec, attr);
+}
+
/* Create a new object attribute subsection with the following properties:
- NAME: the name of the subsection. Note: this parameter never holds a
string literal, so the value has to be freeable.
LINKED_LIST_MERGE_SORT_DECL (obj_attr_subsection_list_t,
obj_attr_subsection_v2_t, /* extern */)
+/* Public API wrapper for LINKED_LIST_APPEND (obj_attr_subsection_v2_t). */
+
+void
+bfd_obj_attr_subsection_v2_list_append (obj_attr_subsection_list_t *l,
+ obj_attr_subsection_v2_t *subsec)
+{
+ LINKED_LIST_APPEND (obj_attr_subsection_v2_t) (l, subsec);
+}
+
+/* Public API wrapper for LINKED_LIST_REMOVE (obj_attr_subsection_v2_t). */
+
+obj_attr_subsection_v2_t *
+bfd_obj_attr_subsection_v2_list_remove (obj_attr_subsection_list_t *l,
+ obj_attr_subsection_v2_t *subsec)
+{
+ return LINKED_LIST_REMOVE (obj_attr_subsection_v2_t) (l, subsec);
+}
+
/* Serialize the object attributes in ABFD into the vendor section of
OUTPUT_BFD. */
(bfd *, file_ptr, bfd_size_type, size_t) ATTRIBUTE_HIDDEN;
extern obj_attr_v2_t *bfd_elf_obj_attr_v2_init (obj_attr_tag_t,
- union obj_attr_value_v2) ATTRIBUTE_HIDDEN;
+ union obj_attr_value_v2);
extern void _bfd_elf_obj_attr_v2_free (obj_attr_v2_t *, obj_attr_encoding_v2_t)
ATTRIBUTE_HIDDEN;
extern obj_attr_v2_t *_bfd_elf_obj_attr_v2_copy (const obj_attr_v2_t *,
obj_attr_encoding_v2_t) ATTRIBUTE_HIDDEN;
extern int _bfd_elf_obj_attr_v2_cmp (const obj_attr_v2_t *,
const obj_attr_v2_t *) ATTRIBUTE_HIDDEN;
-extern obj_attr_v2_t * _bfd_obj_attr_v2_find_by_tag
- (const obj_attr_subsection_v2_t *, obj_attr_tag_t, bool) ATTRIBUTE_HIDDEN;
+extern obj_attr_v2_t *bfd_obj_attr_v2_find_by_tag
+ (const obj_attr_subsection_v2_t *, obj_attr_tag_t, bool);
+extern void bfd_obj_attr_subsection_v2_append
+ (obj_attr_subsection_v2_t *, obj_attr_v2_t *);
LINKED_LIST_MUTATIVE_OPS_PROTOTYPE (obj_attr_subsection_v2_t,
obj_attr_v2_t, ATTRIBUTE_HIDDEN);
LINKED_LIST_MERGE_SORT_PROTOTYPE_ (obj_attr_v2_t, ATTRIBUTE_HIDDEN);
(obj_attr_subsection_v2_t *, const char *, bool);
extern obj_attr_subsection_scope_v2_t bfd_elf_obj_attr_subsection_v2_scope
(const bfd *, const char *);
+extern void bfd_obj_attr_subsection_v2_list_append
+ (obj_attr_subsection_list_t *, obj_attr_subsection_v2_t *);
+extern obj_attr_subsection_v2_t *bfd_obj_attr_subsection_v2_list_remove
+ (obj_attr_subsection_list_t *, obj_attr_subsection_v2_t *);
LINKED_LIST_MUTATIVE_OPS_PROTOTYPE (obj_attr_subsection_list_t,
obj_attr_subsection_v2_t,
ATTRIBUTE_HIDDEN);
if (aeabi_feature_and_bits_subsec != NULL)
{
const obj_attr_v2_t *attr_bti
- = _bfd_obj_attr_v2_find_by_tag (aeabi_feature_and_bits_subsec,
+ = bfd_obj_attr_v2_find_by_tag (aeabi_feature_and_bits_subsec,
Tag_Feature_BTI, true);
if (attr_bti && attr_bti->val.uint == 1)
tdata->sw_protections.plt_type |= PLT_BTI;
bool value)
{
obj_attr_v2_t *attr;
- attr = _bfd_obj_attr_v2_find_by_tag (subsec, tag, false);
+ attr = bfd_obj_attr_v2_find_by_tag (subsec, tag, false);
if (attr != NULL)
{
if (attr->val.uint != value)
int version_id = 0;
const obj_attr_v2_t *attr
- = _bfd_obj_attr_v2_find_by_tag (subsec, Tag_PAuth_Platform, true);
+ = bfd_obj_attr_v2_find_by_tag (subsec, Tag_PAuth_Platform, true);
if (attr != NULL)
platform_id = attr->val.uint;
- attr = _bfd_obj_attr_v2_find_by_tag (subsec, Tag_PAuth_Schema, true);
+ attr = bfd_obj_attr_v2_find_by_tag (subsec, Tag_PAuth_Schema, true);
if (attr != NULL)
version_id = attr->val.uint;
/* Go over the list of already recorded attributes and check for
redefinitions (which are forbidden). */
bool skip_recording = false;
- obj_attr_v2_t *recorded_attr = _bfd_obj_attr_v2_find_by_tag
+ obj_attr_v2_t *recorded_attr = bfd_obj_attr_v2_find_by_tag
(elf_obj_attr_subsections (stdoutput).last, obj_attr->tag, false);
if (recorded_attr != NULL)
{
return;
}
- LINKED_LIST_APPEND (obj_attr_v2_t)
+ bfd_obj_attr_subsection_v2_append
(elf_obj_attr_subsections (stdoutput).last, obj_attr);
}
}
/* Move the existing subsection to the last position. */
- LINKED_LIST_REMOVE (obj_attr_subsection_v2_t)
+ bfd_obj_attr_subsection_v2_list_remove
(&elf_obj_attr_subsections (stdoutput), already_recorded_subsec);
- LINKED_LIST_APPEND (obj_attr_subsection_v2_t)
+ bfd_obj_attr_subsection_v2_list_append
(&elf_obj_attr_subsections (stdoutput), already_recorded_subsec);
/* Note: 'name' was unused, and will be freed on exit. */
}
= bfd_elf_obj_attr_subsection_v2_init (name, scope,
comprehension_optional,
encoding);
- LINKED_LIST_APPEND (obj_attr_subsection_v2_t)
+ bfd_obj_attr_subsection_v2_list_append
(&elf_obj_attr_subsections (stdoutput), new_subsection);
return;
}