bfd *obfd = info->output_bfd;
flagword out_flags;
flagword in_flags;
- bfd_boolean flags_compatible = TRUE;
+ bfd_boolean flags_compatible = FALSE;
asection *sec;
/* Check if we have the same endianess. */
if (!elf_flags_init (obfd))
{
+ elf_flags_init (obfd) = TRUE;
+
/* If the input is the default architecture and had the default
flags then do not bother setting the flags for the output
architecture, instead allow future merges to do this. If no
&& elf_elfheader (ibfd)->e_flags == 0)
return TRUE;
- elf_flags_init (obfd) = TRUE;
elf_elfheader (obfd)->e_flags = in_flags;
if (bfd_get_arch (obfd) == bfd_get_arch (ibfd)
Also check to see if there are no code sections in the input.
In this case there is no need to check for code specific flags.
XXX - do we need to worry about floating-point format compatability
- in data sections ? */
+ in data sections ?
+
+ We definitely need to check for data sections if one set of flags is
+ targetting the PURECAP abi and another is not. Pointers being
+ capabilities in data sections can not be glossed over. */
if (!(ibfd->flags & DYNAMIC))
{
bfd_boolean null_input_bfd = TRUE;
- bfd_boolean only_data_sections = TRUE;
+ bfd_boolean only_data_sections
+ = !(in_flags & EF_AARCH64_CHERI_PURECAP
+ || out_flags & EF_AARCH64_CHERI_PURECAP);
for (sec = ibfd->sections; sec != NULL; sec = sec->next)
{
run_dump_test_lp64 "morello-sizeless-local-syms"
run_dump_test_lp64 "morello-sizeless-global-syms"
run_dump_test_lp64 "morello-sizeless-got-syms"
+run_dump_test_lp64 "morello-disallow-merged-binaries"
run_dump_test_lp64 "morello-capinit"
run_dump_test_lp64 "morello-stubs"