Bfd: Remove redundant lookup of dynamic reloc section.
Removes a redundant name lookup when retrieving the dynamic relocation section, simplifying code in several architectures.
The function _bfd_elf_get_dynamic_reloc_section was used to find the dynamic relocation section by name. However, the section is already available via elf_section_data(sec)->sreloc after _bfd_elf_make_dynamic_reloc_section is called. This commit removes the function and updates architecture-specific code to use the elf_section_data method, making the code simpler.
In Details
The _bfd_elf_get_dynamic_reloc_section function performed a name-based lookup for the dynamic relocation section. When check_relocs calls _bfd_elf_make_dynamic_reloc_section, the sreloc field of the section is guaranteed to be set. This patch removes the redundant lookup and uses the already available sreloc field, simplifying code in elf-m10300.c, elf32-arc.c, elf32-arm.c, elf32-cris.c, elf32-m32r.c, elf32-sh.c, and elf32-vax.c.
For Context
The Binary File Descriptor (BFD) library provides a generic interface to manipulate object files in various formats. Relocation is the process of adjusting addresses in the object file when it is linked or loaded into memory. Dynamic relocation occurs at runtime for shared libraries. This patch simplifies internal BFD code that deals with dynamic relocation sections in ELF files, by removing a lookup function and directly accessing the section data. This internal change makes the code easier to maintain.