base_got = globals->root.sgot;
bfd_boolean is_dynamic = elf_hash_table (info)->dynamic_sections_created;
- bfd_boolean c64_reloc =
- (bfd_r_type == BFD_RELOC_MORELLO_LD128_GOT_LO12_NC
- || bfd_r_type == BFD_RELOC_MORELLO_ADR_GOT_PAGE);
if (signed_addend != 0)
{
BFD_ASSERT (!WILL_CALL_FINISH_DYNAMIC_SYMBOL
(is_dynamic, bfd_link_pic (info), h));
relative_reloc = TRUE;
- c64_needs_frag_fixup = c64_reloc ? TRUE : FALSE;
+ c64_needs_frag_fixup = globals->c64_rel ? TRUE : FALSE;
}
- else if (!c64_reloc || !c64_needs_relocation (info, h))
+ else if (!globals->c64_rel || !c64_needs_relocation (info, h))
{
/* Symbol references via GOT in C64 should always have
relocations of some kind unless they are undefined weak
c64_needs_frag_fixup = TRUE;
}
- if (c64_reloc
+ if (globals->c64_rel
&& c64_symbol_adjust (h, value, sym_sec, info, &frag_value))
signed_addend = (value | h->target_internal) - frag_value;
else
{
bfd_vma frag_value;
- if (c64_reloc
+ if (globals->c64_rel
&& c64_symbol_adjust (h, value, sym_sec, info, &frag_value))
signed_addend = (value | sym->st_target_internal) - frag_value;
else
dynamic relocations). */
if (bfd_link_pic (info)
|| (!bfd_link_pic (info) && bfd_link_executable (info)
- && c64_reloc))
+ && globals->c64_rel))
{
/* We have not handled the case for weak undefined symbols in
this clause. That is because we believe there can not be
would not see it in this clause. */
BFD_ASSERT (!weak_undef_p);
relative_reloc = TRUE;
- c64_needs_frag_fixup = c64_reloc ? TRUE : FALSE;
+ c64_needs_frag_fixup = globals->c64_rel ? TRUE : FALSE;
}
symbol_got_offset_mark (input_bfd, h, r_symndx);
if (c64_needs_frag_fixup)
{
- BFD_ASSERT (c64_reloc);
+ BFD_ASSERT (globals->c64_rel);
/* For a C64 relative relocation, also add size and permissions into
the frag. */
bfd_reloc_status_type ret;
s = globals->root.srelgot;
- if (c64_reloc)
+ if (globals->c64_rel)
{
rtype = MORELLO_R (RELATIVE);
--- /dev/null
+# Checking that we have two RELATIVE relocations, indicating that both the
+# CAPINIT and the GOT entry were given a RELATIVE relocation. As opposed to
+# before when the linker generated one RELATIVE relocation and an
+# R_AARCH64_NONE relocation.
+#as: -march=morello+c64
+#ld:
+#readelf: --relocs
+
+Relocation section '\.rela\.dyn' at offset .* contains 2 entries:
+ Offset Info Type Sym\. Value Sym\. Name \+ Addend
+[0-9a-f]+ [0-9a-f]+ R_MORELLO_RELATIV 0
+[0-9a-f]+ [0-9a-f]+ R_MORELLO_RELATIV 0