+2023-05-10 Luca Bonissi <gcc@scarsita.it>
+
+ PR 30422
+ * elf32-or1k.c (or1k_elf_relocate_section): Prescan for
+ R_OR1K_GOT_AHI16 relocs as they may occur after R_OR1K_GOT16
+ relocs.
+
2023-05-05 Nick Clifton <nickc@redhat.com>
PR 30354
sym_hashes = elf_sym_hashes (input_bfd);
relend = relocs + input_section->reloc_count;
+ /* Make a full scan for R_OR1K_GOT_AHI16, since it could be AFTER R_OR1K_GOT16. */
+ for (rel = relocs; rel < relend; rel++)
+ {
+ int r_type = ELF32_R_TYPE (rel->r_info);
+ if (r_type==R_OR1K_GOT_AHI16)
+ {
+ saw_gotha = true;
+ break;
+ }
+ }
+
for (rel = relocs; rel < relend; rel++)
{
reloc_howto_type *howto;
|| r_type == R_OR1K_GOT_AHI16)
relocation -= got_sym_value;
- if (r_type == R_OR1K_GOT_AHI16)
- saw_gotha = true;
-
/* If we have a R_OR1K_GOT16 following a R_OR1K_GOT_AHI16
relocation we assume the code is doing the right thing to avoid
overflows. */