bfd_vma tlsdesc_got_jump_table_offset;
};
-struct elf_aarch64_obj_tdata
-{
- struct elf_obj_tdata root;
-
- /* local symbol descriptors */
- struct elf_aarch64_local_symbol *locals;
-
- /* Zero to warn when linking objects with incompatible enum sizes. */
- int no_enum_size_warning;
-
- /* Zero to warn when linking objects with incompatible wchar_t sizes. */
- int no_wchar_size_warning;
-
- /* All GNU_PROPERTY_AARCH64_FEATURE_1_AND properties. */
- uint32_t gnu_property_aarch64_feature_1_and;
-
- /* Software protections options. */
- struct aarch64_protection_opts sw_protections;
-};
-
-#define elf_aarch64_tdata(bfd) \
- ((struct elf_aarch64_obj_tdata *) (bfd)->tdata.any)
-
#define elf_aarch64_locals(bfd) (elf_aarch64_tdata (bfd)->locals)
#define is_aarch64_elf(bfd) \
static bfd *
elfNN_aarch64_link_setup_gnu_properties (struct bfd_link_info *info)
{
+ bfd *pbfd = _bfd_aarch64_elf_link_setup_gnu_properties (info);
+
+ /* When BTI is forced on the command line, information flows from plt_type to
+ outprop, so plt_type has already been set and outprop don't have any effect
+ on plt_type.
+ Whereas if BTI is inferred from the input bfds, information flows from
+ outprop to plt_type. If the property GNU_PROPERTY_AARCH64_FEATURE_1_BTI
+ has been set on all the input bfds, then BTI is set on the output bfd and
+ plt_type is updated accordingly. */
struct elf_aarch64_obj_tdata * tdata = elf_aarch64_tdata (info->output_bfd);
uint32_t outprop = tdata->gnu_property_aarch64_feature_1_and;
- bfd *pbfd = _bfd_aarch64_elf_link_setup_gnu_properties (info, &outprop);
- tdata->gnu_property_aarch64_feature_1_and = outprop;
- tdata->sw_protections.plt_type
- |= (outprop & GNU_PROPERTY_AARCH64_FEATURE_1_BTI) ? PLT_BTI : 0;
+ if (outprop & GNU_PROPERTY_AARCH64_FEATURE_1_BTI)
+ tdata->sw_protections.plt_type |= PLT_BTI;
setup_plt_values (info, tdata->sw_protections.plt_type);
return pbfd;
}
such input is found, add it to a new section at the last input. Update
GPROP accordingly. */
bfd *
-_bfd_aarch64_elf_link_setup_gnu_properties (struct bfd_link_info *info,
- uint32_t *gprop)
+_bfd_aarch64_elf_link_setup_gnu_properties (struct bfd_link_info *info)
{
asection *sec;
bfd *pbfd;
elf_property *prop;
unsigned align;
- uint32_t outprop = *gprop;
+ struct elf_aarch64_obj_tdata *tdata = elf_aarch64_tdata (info->output_bfd);
+ uint32_t outprop = tdata->gnu_property_aarch64_feature_1_and;
/* Find a normal input file with GNU property note. */
for (pbfd = info->input_bfds;
break;
}
}
- *gprop = outprop;
+
+ tdata->gnu_property_aarch64_feature_1_and = outprop;
return pbfd;
}
};
typedef struct aarch64_protection_opts aarch64_protection_opts;
+struct elf_aarch64_local_symbol;
+struct elf_aarch64_obj_tdata
+{
+ struct elf_obj_tdata root;
+
+ /* local symbol descriptors */
+ struct elf_aarch64_local_symbol *locals;
+
+ /* Zero to warn when linking objects with incompatible enum sizes. */
+ int no_enum_size_warning;
+
+ /* Zero to warn when linking objects with incompatible wchar_t sizes. */
+ int no_wchar_size_warning;
+
+ /* All GNU_PROPERTY_AARCH64_FEATURE_1_AND properties. */
+ uint32_t gnu_property_aarch64_feature_1_and;
+
+ /* Software protections options. */
+ struct aarch64_protection_opts sw_protections;
+};
+
+#define elf_aarch64_tdata(bfd) \
+ ((struct elf_aarch64_obj_tdata *) (bfd)->tdata.any)
+
/* An enum to define what kind of erratum fixes we should apply. This gives the
user a bit more control over the sequences we generate. */
typedef enum
#define elf_backend_write_core_note _bfd_aarch64_elf_write_core_note
extern bfd *
-_bfd_aarch64_elf_link_setup_gnu_properties (struct bfd_link_info *,
- uint32_t *);
+_bfd_aarch64_elf_link_setup_gnu_properties (struct bfd_link_info *);
extern enum elf_property_kind
_bfd_aarch64_elf_parse_gnu_properties (bfd *, unsigned int,