Consolidate stub BFD creation in ELF targets
Stub BFD creation logic consolidated to ldelf.c for ELF targets, affecting orphan section placement on MIPS.
This change consolidates the creation of stub BFDs for ELF targets into a single location in ldelf.c. While not altering target behavior generally, it changes when MIPS creates its stub BFD, potentially affecting orphan section placement. The fix involves explicitly specifying section locations to resolve test failures.
In Details
The elf_backend_data::want_stub_bfd field is introduced and initialized across various ELF targets. This consolidates the stub BFD creation logic into ldelf_after_open_output, addressing an issue where MIPS delayed stub BFD creation, impacting orphan section placement. Fixes involve explicit section placement overrides.
- stub BFD
- A minimal Binary File Descriptor (BFD) object used by the linker to represent sections or symbols before the full BFD is available. It serves as a placeholder.
- orphan section
- A section in an object file that has not yet been assigned a final location or properties by the linker. These sections may become 'orphaned' if not explicitly handled.
- MIPS
- A family of reduced instruction set computer (RISC) architectures, widely used in embedded systems and formerly in workstations.
- ELF
- Executable and Linkable Format, a common standard for object file formats on Unix-like systems.