llvm-project
5e87f814 - [ELF] Add target-specific relocation scanning for PPC32 (#181517)

Commit
76 days ago
[ELF] Add target-specific relocation scanning for PPC32 (#181517) Implement PPC::scanSectionImpl, following the pattern established for x86 (#178846) and PPC64 (#181496). This merges the getRelExpr and TLS handling for SHF_ALLOC sections into the target-specific scanner, enabling devirtualization and eliminating abstraction overhead. - Inline relocation classification into scanSectionImpl with a switch on relocation type, replacing the generic rs.scan() path. - Use processR_PC/processR_PLT_PC for common PC-relative and PLT relocations. - Handle R_PPC_PLTREL24 inline with addend masking via processAux, removing the EM_PPC special case from process(). - Handle TLS GD/LD/IE directly, eliminating handleTlsRelocation, getTlsGdRelaxSkip, and adjustTlsExpr overrides. Use handleTlsIe for TLS IE, and handleTlsGd for R_PPC_GOT_TLSGD16. - Use R_DTPREL unconditionally for DTPREL relocations, removing R_RELAX_TLS_LD_TO_LE_ABS (PPC32 was the only user). - Move TLS relaxation dispatch from relocateAlloc into relocate, removing the relocateAlloc override. - Simplify getRelExpr to only handle relocations needed by relocateNonAlloc and .eh_frame.
Author
Parents
Loading