]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
bfd/ELF: properly mark elf_appent_rel{a,}() as private
authorJan Beulich <jbeulich@suse.com>
Fri, 7 Nov 2025 13:57:36 +0000 (14:57 +0100)
committerJan Beulich <jbeulich@suse.com>
Fri, 7 Nov 2025 13:57:36 +0000 (14:57 +0100)
Add _bfd_ prefixes and make them hidden.

bfd/elf-bfd.h
bfd/elf32-i386.c
bfd/elf32-s390.c
bfd/elf64-s390.c
bfd/elf64-x86-64.c
bfd/elflink.c
bfd/elfnn-aarch64.c
bfd/elfnn-kvx.c
bfd/elfxx-x86.c

index 8c3639f00eb9d8b9890294f4595d5d268d9418ea..8f5fb764324a0e23e94633d4ba3dd7c0a6a0b6a1 100644 (file)
@@ -3177,8 +3177,10 @@ extern bool _bfd_elf_allocate_ifunc_dyn_relocs
    struct elf_dyn_relocs **, unsigned int, unsigned int,
    unsigned int, bool) ATTRIBUTE_HIDDEN;
 
-extern void elf_append_rela (bfd *, asection *, Elf_Internal_Rela *);
-extern void elf_append_rel (bfd *, asection *, Elf_Internal_Rela *);
+extern void _bfd_elf_append_rela
+  (bfd *, asection *, Elf_Internal_Rela *) ATTRIBUTE_HIDDEN;
+extern void _bfd_elf_append_rel
+  (bfd *, asection *, Elf_Internal_Rela *) ATTRIBUTE_HIDDEN;
 
 extern bfd_vma elf64_r_info (bfd_vma, bfd_vma);
 extern bfd_vma elf64_r_sym (bfd_vma);
index 0d60eded7010117942d70b55a61691f37d91eca0..c88713344274780e70da8bc1f8d1d3392df0a1ac 100644 (file)
@@ -2547,7 +2547,7 @@ elf_i386_relocate_section (bfd *output_bfd,
                    sreloc = htab->elf.srelgot;
                  else
                    sreloc = htab->elf.irelplt;
-                 elf_append_rel (output_bfd, sreloc, &outrel);
+                 _bfd_elf_append_rel (output_bfd, sreloc, &outrel);
 
                  /* If this reloc is against an external symbol, we
                     do not want to fiddle with the addend.  Otherwise,
@@ -2666,7 +2666,7 @@ elf_i386_relocate_section (bfd *output_bfd,
                  (info, input_section, h, sym, "R_386_RELATIVE",
                   &outrel);
 
-             elf_append_rel (output_bfd, s, &outrel);
+             _bfd_elf_append_rel (output_bfd, s, &outrel);
            }
 
          if (off >= (bfd_vma) -2)
@@ -2898,7 +2898,7 @@ elf_i386_relocate_section (bfd *output_bfd,
                      goto check_relocation_error;
                    }
 
-                 elf_append_rel (output_bfd, sreloc, &outrel);
+                 _bfd_elf_append_rel (output_bfd, sreloc, &outrel);
                }
 
              /* If this reloc is against an external symbol, we do
@@ -2929,7 +2929,7 @@ elf_i386_relocate_section (bfd *output_bfd,
              sreloc = elf_section_data (input_section)->sreloc;
              if (sreloc == NULL)
                abort ();
-             elf_append_rel (output_bfd, sreloc, &outrel);
+             _bfd_elf_append_rel (output_bfd, sreloc, &outrel);
            }
          /* Fall through */
 
@@ -3192,7 +3192,7 @@ elf_i386_relocate_section (bfd *output_bfd,
                                     + offplt
                                     + htab->sgotplt_jump_table_size);
                  sreloc = htab->rel_tls_desc;
-                 elf_append_rel (output_bfd, sreloc, &outrel);
+                 _bfd_elf_append_rel (output_bfd, sreloc, &outrel);
                  if (indx == 0)
                    {
                      BFD_ASSERT (! unresolved_reloc);
@@ -3236,7 +3236,7 @@ elf_i386_relocate_section (bfd *output_bfd,
                            htab->elf.sgot->contents + off);
              outrel.r_info = ELF32_R_INFO (indx, dr_type);
 
-             elf_append_rel (output_bfd, sreloc, &outrel);
+             _bfd_elf_append_rel (output_bfd, sreloc, &outrel);
 
              if (GOT_TLS_GD_P (tls_type))
                {
@@ -3254,7 +3254,7 @@ elf_i386_relocate_section (bfd *output_bfd,
                      outrel.r_info = ELF32_R_INFO (indx,
                                                    R_386_TLS_DTPOFF32);
                      outrel.r_offset += 4;
-                     elf_append_rel (output_bfd, sreloc, &outrel);
+                     _bfd_elf_append_rel (output_bfd, sreloc, &outrel);
                    }
                }
              else if (tls_type == GOT_TLS_IE_BOTH)
@@ -3266,7 +3266,7 @@ elf_i386_relocate_section (bfd *output_bfd,
                              htab->elf.sgot->contents + off + 4);
                  outrel.r_info = ELF32_R_INFO (indx, R_386_TLS_TPOFF);
                  outrel.r_offset += 4;
-                 elf_append_rel (output_bfd, sreloc, &outrel);
+                 _bfd_elf_append_rel (output_bfd, sreloc, &outrel);
                }
 
            dr_done:
@@ -3492,7 +3492,7 @@ elf_i386_relocate_section (bfd *output_bfd,
              bfd_put_32 (output_bfd, 0,
                          htab->elf.sgot->contents + off + 4);
              outrel.r_info = ELF32_R_INFO (0, R_386_TLS_DTPMOD32);
-             elf_append_rel (output_bfd, htab->elf.srelgot, &outrel);
+             _bfd_elf_append_rel (output_bfd, htab->elf.srelgot, &outrel);
              htab->tls_ld_or_ldm_got.offset |= 1;
            }
          relocation = htab->elf.sgot->output_section->vma
@@ -3532,7 +3532,7 @@ elf_i386_relocate_section (bfd *output_bfd,
              sreloc = elf_section_data (input_section)->sreloc;
              if (sreloc == NULL)
                abort ();
-             elf_append_rel (output_bfd, sreloc, &outrel);
+             _bfd_elf_append_rel (output_bfd, sreloc, &outrel);
              if (indx)
                continue;
              else if (r_type == R_386_TLS_LE_32)
@@ -4026,7 +4026,7 @@ elf_i386_finish_dynamic_symbol (bfd *output_bfd,
            _bfd_x86_elf_link_report_relative_reloc
              (info, relgot, h, sym, relative_reloc_name, &rel);
 
-         elf_append_rel (output_bfd, relgot, &rel);
+         _bfd_elf_append_rel (output_bfd, relgot, &rel);
        }
     }
 
@@ -4046,7 +4046,7 @@ elf_i386_finish_dynamic_symbol (bfd *output_bfd,
        s = htab->elf.sreldynrelro;
       else
        s = htab->elf.srelbss;
-      elf_append_rel (output_bfd, s, &rel);
+      _bfd_elf_append_rel (output_bfd, s, &rel);
     }
 
   return true;
index 1216aeed1ab2b1eda38a8239a5a3eb4d31a9d639..52aad070d4411e66703cf0f8c319988df6800e37 100644 (file)
@@ -2532,7 +2532,7 @@ elf_s390_relocate_section (bfd *output_bfd,
                    }
 
                  sreloc = htab->elf.irelifunc;
-                 elf_append_rela (output_bfd, sreloc, &outrel);
+                 _bfd_elf_append_rela (output_bfd, sreloc, &outrel);
 
                  /* If this reloc is against an external symbol, we
                     do not want to fiddle with the addend.  Otherwise,
index 8e41104b580cfd6cc4619391d2b9c25309900202..96ba8b3cd77ef1bde8cc96c0602b0d4f86a2c8b5 100644 (file)
@@ -2906,7 +2906,7 @@ elf_s390_relocate_section (bfd *output_bfd,
                    }
 
                  sreloc = htab->elf.irelifunc;
-                 elf_append_rela (output_bfd, sreloc, &outrel);
+                 _bfd_elf_append_rela (output_bfd, sreloc, &outrel);
 
                  /* If this reloc is against an external symbol, we
                     do not want to fiddle with the addend.  Otherwise,
index a4a5ebf595e7092d30fb9431a621741aa5f21e2d..199fe3bf139c7cedb93a801f5c531b5fa7587f67 100644 (file)
@@ -3566,7 +3566,7 @@ elf_x86_64_relocate_section (bfd *output_bfd,
                    sreloc = htab->elf.srelgot;
                  else
                    sreloc = htab->elf.irelplt;
-                 elf_append_rela (output_bfd, sreloc, &outrel);
+                 _bfd_elf_append_rela (output_bfd, sreloc, &outrel);
 
                  /* If this reloc is against an external symbol, we
                     do not want to fiddle with the addend.  Otherwise,
@@ -3721,7 +3721,7 @@ elf_x86_64_relocate_section (bfd *output_bfd,
                  (info, input_section, h, sym, "R_X86_64_RELATIVE",
                   &outrel);
 
-             elf_append_rela (output_bfd, s, &outrel);
+             _bfd_elf_append_rela (output_bfd, s, &outrel);
            }
 
          if (off >= (bfd_vma) -2)
@@ -4138,7 +4138,7 @@ elf_x86_64_relocate_section (bfd *output_bfd,
                      (info, input_section, h, sym,
                       relative_reloc_name, &outrel);
 
-                 elf_append_rela (output_bfd, sreloc, &outrel);
+                 _bfd_elf_append_rela (output_bfd, sreloc, &outrel);
                }
 
              /* If this reloc is against an external symbol, we do
@@ -4659,7 +4659,7 @@ elf_x86_64_relocate_section (bfd *output_bfd,
                    outrel.r_addend = relocation - _bfd_x86_elf_dtpoff_base (info);
                  else
                    outrel.r_addend = 0;
-                 elf_append_rela (output_bfd, sreloc, &outrel);
+                 _bfd_elf_append_rela (output_bfd, sreloc, &outrel);
                }
 
              sreloc = htab->elf.srelgot;
@@ -4681,7 +4681,7 @@ elf_x86_64_relocate_section (bfd *output_bfd,
                outrel.r_addend = relocation - _bfd_x86_elf_dtpoff_base (info);
              outrel.r_info = htab->r_info (indx, dr_type);
 
-             elf_append_rela (output_bfd, sreloc, &outrel);
+             _bfd_elf_append_rela (output_bfd, sreloc, &outrel);
 
              if (GOT_TLS_GD_P (tls_type))
                {
@@ -4699,8 +4699,7 @@ elf_x86_64_relocate_section (bfd *output_bfd,
                      outrel.r_info = htab->r_info (indx,
                                                    R_X86_64_DTPOFF64);
                      outrel.r_offset += GOT_ENTRY_SIZE;
-                     elf_append_rela (output_bfd, sreloc,
-                                               &outrel);
+                     _bfd_elf_append_rela (output_bfd, sreloc, &outrel);
                    }
                }
 
@@ -5003,8 +5002,7 @@ elf_x86_64_relocate_section (bfd *output_bfd,
                          htab->elf.sgot->contents + off + GOT_ENTRY_SIZE);
              outrel.r_info = htab->r_info (0, R_X86_64_DTPMOD64);
              outrel.r_addend = 0;
-             elf_append_rela (output_bfd, htab->elf.srelgot,
-                                       &outrel);
+             _bfd_elf_append_rela (output_bfd, htab->elf.srelgot, &outrel);
              htab->tls_ld_or_ldm_got.offset |= 1;
            }
          relocation = htab->elf.sgot->output_section->vma
@@ -5539,7 +5537,7 @@ elf_x86_64_finish_dynamic_symbol (bfd *output_bfd,
            _bfd_x86_elf_link_report_relative_reloc
              (info, relgot, h, sym, relative_reloc_name, &rela);
 
-         elf_append_rela (output_bfd, relgot, &rela);
+         _bfd_elf_append_rela (output_bfd, relgot, &rela);
        }
     }
 
@@ -5560,7 +5558,7 @@ elf_x86_64_finish_dynamic_symbol (bfd *output_bfd,
        s = htab->elf.sreldynrelro;
       else
        s = htab->elf.srelbss;
-      elf_append_rela (output_bfd, s, &rela);
+      _bfd_elf_append_rela (output_bfd, s, &rela);
     }
 
   return true;
index f73ceb23c8b3b022cad85e5882bfa9b16bd298a9..635fdec8bbe6d6ba5bad15a2623caaaa8f9a5302 100644 (file)
@@ -15620,7 +15620,7 @@ _bfd_elf_copy_link_hash_symbol_type (bfd *abfd,
 /* Append a RELA relocation REL to section S in BFD.  */
 
 void
-elf_append_rela (bfd *abfd, asection *s, Elf_Internal_Rela *rel)
+_bfd_elf_append_rela (bfd *abfd, asection *s, Elf_Internal_Rela *rel)
 {
   const struct elf_backend_data *bed = get_elf_backend_data (abfd);
   bfd_byte *loc = s->contents + (s->reloc_count++ * bed->s->sizeof_rela);
@@ -15631,7 +15631,7 @@ elf_append_rela (bfd *abfd, asection *s, Elf_Internal_Rela *rel)
 /* Append a REL relocation REL to section S in BFD.  */
 
 void
-elf_append_rel (bfd *abfd, asection *s, Elf_Internal_Rela *rel)
+_bfd_elf_append_rel (bfd *abfd, asection *s, Elf_Internal_Rela *rel)
 {
   const struct elf_backend_data *bed = get_elf_backend_data (abfd);
   bfd_byte *loc = s->contents + (s->reloc_count++ * bed->s->sizeof_rel);
index b529c3d43cca1690c4a3310bd5d80237be5bb872..60bc946d19656a86e5b5bda98e376dd7cf95d153 100644 (file)
@@ -5825,7 +5825,7 @@ elfNN_aarch64_final_link_relocate (reloc_howto_type *howto,
                }
 
              sreloc = globals->root.irelifunc;
-             elf_append_rela (output_bfd, sreloc, &outrel);
+             _bfd_elf_append_rela (output_bfd, sreloc, &outrel);
 
              /* If this reloc is against an external symbol, we
                 do not want to fiddle with the addend.  Otherwise,
@@ -6290,7 +6290,7 @@ elfNN_aarch64_final_link_relocate (reloc_howto_type *howto,
          outrel.r_offset = got_entry_addr;
          outrel.r_info = ELFNN_R_INFO (0, AARCH64_R (RELATIVE));
          outrel.r_addend = orig_value;
-         elf_append_rela (output_bfd, s, &outrel);
+         _bfd_elf_append_rela (output_bfd, s, &outrel);
        }
       break;
 
index 3b44db5742147a150b7bb442aad8ae56a03f7109..fb71a5bc96202a902858dfdc48a09f56d2b9d0c1 100644 (file)
@@ -2408,7 +2408,7 @@ elfNN_kvx_final_link_relocate (reloc_howto_type *howto,
                  outrel.r_offset = got_entry_addr;
                  outrel.r_info = ELFNN_R_INFO (0, R_KVX_RELATIVE);
                  outrel.r_addend = value;
-                 elf_append_rela (output_bfd, s, &outrel);
+                 _bfd_elf_append_rela (output_bfd, s, &outrel);
                }
 
              symbol_got_offset_mark (input_bfd, h, r_symndx);
index 7a54722bd27535aa8eca11cc7d6950c887a8b4f1..842d600d5e41ddfa900dba235dc49c7b1137052c 100644 (file)
@@ -731,7 +731,7 @@ _bfd_x86_elf_link_hash_table_create (bfd *abfd)
       ret->relative_r_type = R_X86_64_RELATIVE;
       ret->relative_r_name = "R_X86_64_RELATIVE";
       ret->ax_register = "RAX";
-      ret->elf_append_reloc = elf_append_rela;
+      ret->elf_append_reloc = _bfd_elf_append_rela;
       ret->elf_write_addend_in_got = _bfd_elf64_write_addend;
     }
   if (ABI_64_P (abfd))
@@ -763,7 +763,7 @@ _bfd_x86_elf_link_hash_table_create (bfd *abfd)
          ret->relative_r_type = R_386_RELATIVE;
          ret->relative_r_name = "R_386_RELATIVE";
          ret->ax_register = "EAX";
-         ret->elf_append_reloc = elf_append_rel;
+         ret->elf_append_reloc = _bfd_elf_append_rel;
          ret->elf_write_addend = _bfd_elf32_write_addend;
          ret->elf_write_addend_in_got = _bfd_elf32_write_addend;
          ret->dynamic_interpreter = ELF32_DYNAMIC_INTERPRETER;