static void
oav2_translate_gnu_props_to_obj_attrs (const bfd *abfd)
{
- (void) abfd;
- /* TO IMPLEMENT */
+ const struct elf_backend_data *be = get_elf_backend_data (abfd);
+ if (be->translate_gnu_props_to_obj_attrs == NULL)
+ return;
+
+ for (const elf_property_list *p = elf_properties (abfd);
+ p != NULL;
+ p = p->next)
+ be->translate_gnu_props_to_obj_attrs (abfd, p);
}
/* Translate object attributes v2 that have GNU properties equivalents. */
static void
oav2_translate_obj_attrs_to_gnu_props (bfd *abfd)
{
- (void) abfd;
- /* TO IMPLEMENT */
+ const struct elf_backend_data *be = get_elf_backend_data (abfd);
+ if (be->translate_obj_attrs_to_gnu_props == NULL)
+ return;
+
+ for (const obj_attr_subsection_v2_t *subsec
+ = elf_obj_attr_subsections (abfd).first;
+ subsec != NULL;
+ subsec = subsec->next)
+ be->translate_obj_attrs_to_gnu_props (abfd, subsec);
}
/* Compact duplicated tag declarations in a subsection.
/* The size of the array of known subsections. */
const size_t obj_attr_v2_known_subsections_size;
+ /* Translate GNU properties that have object attributes v2 equivalents. */
+ void (*translate_gnu_props_to_obj_attrs) (const bfd *,
+ const elf_property_list *);
+
+ /* Translate object attributes v2 that have GNU properties equivalents. */
+ void (*translate_obj_attrs_to_gnu_props) (bfd *,
+ const obj_attr_subsection_v2_t *);
+
/* Get default value for an attribute. */
bool (*obj_attr_v2_default_value) (const struct bfd_link_info *,
const obj_attr_info_t *, const obj_attr_subsection_v2_t *, obj_attr_v2_t *);
#ifndef elf_backend_obj_attr_v2_known_subsections_size
#define elf_backend_obj_attr_v2_known_subsections_size 0
#endif
+#ifndef elf_backend_translate_gnu_props_to_obj_attrs
+#define elf_backend_translate_gnu_props_to_obj_attrs NULL
+#endif
+#ifndef elf_backend_translate_obj_attrs_to_gnu_props
+#define elf_backend_translate_obj_attrs_to_gnu_props NULL
+#endif
#ifndef elf_backend_obj_attr_v2_default_value
#define elf_backend_obj_attr_v2_default_value NULL
#endif
elf_backend_obj_attrs_version_enc,
elf_backend_obj_attr_v2_known_subsections,
elf_backend_obj_attr_v2_known_subsections_size,
+ elf_backend_translate_gnu_props_to_obj_attrs,
+ elf_backend_translate_obj_attrs_to_gnu_props,
elf_backend_obj_attr_v2_default_value,
elf_backend_obj_attr_v2_merge,
elf_backend_obj_attrs_order,