GOT section creation in check_relocs for multiple architectures
Ensures GOT sections are created correctly in check_relocs for bfin, frv, m68k, and vax.
This commit refactors the GOT section creation logic within the check_relocs function for several architectures, including bfin, frv, m68k, and vax. The GOT section is now consistently created outside of a conditional check for dynobj, improving code clarity and ensuring its presence when needed.
In Details
Moves the call to _bfd_elf_create_got_section outside the dynobj == NULL test in check_relocs for bfin, frv, m68k, and vax architectures. Previously, the GOT section might not have been created if dynobj was already set, leading to potential confusion. This change simplifies the logic and guarantees GOT creation when relocations require it, regardless of the dynobj state.
- GOT
- Global Offset Table. A table used in position-independent code (PIC) to store addresses of global variables and functions, allowing them to be resolved at runtime.
- check_relocs
- A function in BFD that verifies and processes relocation entries within an object file during the linking process.
- dynobj
- Represents the dynamic object file being processed by the linker, containing information about dynamic symbols and sections.
- relocations
- Information embedded in an object file that specifies how addresses and symbols need to be adjusted when the object is linked or loaded into memory.