Re: LoongArch: Fix relaxation alignment with ld -r (PR 33236) 33236)

Alan Modra <[email protected]>
Newsgroups gmane.comp.gnu.binutils
Message-ID <[email protected]>
Correct sh_size and sh_entsize to use external reloc size.
loongarch32-elf  +FAIL: Linkonce sections with assembler generated notes
loongarch32-elf  +FAIL: ld-loongarch-elf/relax-align-ld-r

diff --git a/bfd/elfnn-loongarch.c b/bfd/elfnn-loongarch.c
index f4d8d32ff2f..11008133255 100644
--- a/bfd/elfnn-loongarch.c
+++ b/bfd/elfnn-loongarch.c
@@ -7096,8 +7096,8 @@ loongarch_add_align_relocs (asection *align_sec, bfd* align_bfd)
       if (rela_hdr == NULL)
        return false;
 
-      rela_hdr->sh_size = sizeof (Elf_Internal_Rela);
-      rela_hdr->sh_entsize = sizeof (Elf_Internal_Rela);
+      rela_hdr->sh_size = sizeof (ElfNN_External_Rela);
+      rela_hdr->sh_entsize = sizeof (ElfNN_External_Rela);
       rela_hdr->sh_type = SHT_RELA;
       rela_hdr->sh_addralign = (bfd_vma) 1 << bed->s->log_file_align;
       elf_section_data (align_sec)->rela.hdr = rela_hdr;

-- 
Alan Modra
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.