bfd/epiphany: remove unused epiphany_relaxed variable
Removes an unused variable `epiphany_relaxed` from the BFD epiphany backend after it was identified as unused and flagged by a compiler warning.
This patch removes the epiphany_relaxed variable from the BFD epiphany backend code. The variable was identified as being set but never used, triggering a compiler warning with -Werror=unused-but-set-global. It has been unused since the epiphany port was initially added to binutils in 2011.
- proposer
Proposes removing the `epiphany_relaxed` variable because it is set but unused, causing compiler warnings.
“Building bfd with a recent clang fails with: /home/smarchi/src/binutils-gdb/bfd/elf32-epiphany.c:45:13: error: variable 'epiphany_relaxed' set but not used [-Werror,-Wunused-but-set-global] The variable has been unused since the epiphany port was added in commit cfb8c0921c8a (2011-10-25). Remove it.”
- reviewer
Agrees with the removal of the unused variable.
“OK.”
- proposer
Confirms the patch has been applied.
Technical Tradeoffs
- Removes dead code, improving maintainability.
- Addresses compiler warnings.
In Details
This is a cleanup patch for the BFD backend supporting the Epiphany architecture. It removes a global variable, epiphany_relaxed, from bfd/elf32-epiphany.c that has been syntactically present but functionally unused since the initial introduction of the Epiphany port. A recent compiler (Clang) with stricter warning flags (-Werror=unused-but-set-global) flagged this variable, prompting its removal to maintain code hygiene.
- BFD
- Binary File Descriptor library. A low-level library used by binutils to abstract over various object file formats (like ELF, a.out, COFF).
- Epiphany
- A VLIW (Very Long Instruction Word) processor architecture, often used in embedded systems and accelerators.
- ELF
- Executable and Linkable Format. A common standard file format for object files, executables, and shared libraries on Unix-like systems.
- unused-but-set-global
- A compiler warning indicating that a global variable has been assigned a value but is never subsequently read or used.