Linker dynamic object handling accepts plugin and dynamic inputs
Binutils linker's dynamic object processing now correctly handles plugin objects and dynamic libraries.
The _bfd_elf_link_dynobj function in binutils has been enhanced to accept BFD_PLUGIN objects and dynamic libraries as valid inputs when linking dynamic objects. This resolves issues on targets like x86_64-linux where test cases utilize these types for dynamic linking, and also simplifies the function by removing an unused abfd parameter.
In Details
The _bfd_elf_link_dynobj function in elflink.c previously rejected BFD_PLUGIN and dynamic objects as potential candidates for the dynamic object input. This patch removes those restrictions, allowing these types to be used. This is crucial for certain test cases and real-world scenarios where plugins or dynamic libraries themselves might need to be processed in the context of creating dynamic sections. The unused abfd parameter, previously passed to _bfd_elf_link_dynobj primarily for its xvec, has been removed as it is no longer necessary.
- BFD_PLUGIN
- A type of BFD representing a plugin loaded by the linker, which can provide custom object file format support or linking logic.
- dynamic object
- A shared library or executable that relies on dynamic linking, where external symbols are resolved at runtime rather than compile time.
- plugin
- A software component that adds specific features or functionality to an existing application or system. In binutils, plugins can extend linker capabilities.
- BFD
- Binary File Descriptor. A data structure used by the GNU Binutils to represent and manipulate object files and executables in a generic way, abstracting underlying formats like ELF or COFF.
- ELF
- Executable and Linkable Format. A standard file format for object files, executables, and shared libraries on many Unix-like systems.