bfd/ELF: Fold GOTOFF relocations for FRV and LM32
Consolidates GOTOFF relocation types in BFD for FRV and LM32, simplifying code and maintaining compatibility.
This commit refactors the handling of GOTOFF relocations in the BFD library for FRV and LM32 architectures. It folds specific architecture-dependent GOTOFF relocations into more generic types (e.g., BFD_RELOC_FRV_GOTOFFLO to BFD_RELOC_LO16_GOTOFF), reducing code duplication and simplifying the relocation management. This change ensures that generated files in opcodes/ are consistent, preventing build breakage when these files are regenerated.
In Details
The commit merges architecture-specific GOTOFF relocation types (e.g., BFD_RELOC_FRV_GOTOFFLO, BFD_RELOC_LM32_GOTOFF_HI16) into common BFD_RELOC_HI16_GOTOFF and BFD_RELOC_LO16_GOTOFF types. This affects cgen (C GENecration) based targets' opcodes files (cpu/frv.opc, cpu/lm32.opc) to use the unified relocations. This change rectifies an issue where the consolidation in a previous commit missed updating these specific files, leading to build failures if the opcode files were regenerated.
- BFD
- The Binary Descriptor Format, a library used by GNU Binutils to provide a common interface to various object file formats, such as ELF and a.out.
- GOTOFF relocation
- A type of relocation used in ELF object files for addressing Global Offset Table (GOT) entries. Specifically, it's used for offsets relative to the GOT, often combined with HI/LO16 variants for 16-bit quantities.
- ELF
- Executable and Linkable Format, a standard file format for object files in Unix-like operating systems. It's used for executables, shared libraries, and object files.
- FRV
- Fujitsu RISC microprocessors, a family of processors targeted by the Binutils toolchain.
- LM32
- LatticeMico32, an open-source soft microprocessor core for FPGAs, also targeted by Binutils.
- relocation
- A placeholder in object code that the linker resolves. It typically indicates an address or symbol that needs to be patched up to create a final executable or shared library.