[ELF] Add ELFFileBase::{elfShdrs,numELFShdrs} to avoid duplicate llvm::object::ELFFil...
authorFangrui Song <i@maskray.me>
Sat, 25 Dec 2021 01:10:38 +0000 (17:10 -0800)
committerFangrui Song <i@maskray.me>
Sat, 25 Dec 2021 01:10:38 +0000 (17:10 -0800)
commitb5a0f0f397c778cc7db71754c1b9c939f669568e
tree05fa2d7693bb699e6711ddc1881d5f7c7ef20eb5
parent2709fd1520bca98667db9c10b3156cac892949bc
[ELF] Add ELFFileBase::{elfShdrs,numELFShdrs} to avoid duplicate llvm::object::ELFFile::sections()

This mainly avoid `relsOrRelas` cost in `InputSectionBase::relocate`.
`llvm::object::ELFFile::sections()` has redundant and expensive checks.
lld/ELF/DWARF.cpp
lld/ELF/Driver.cpp
lld/ELF/InputFiles.cpp
lld/ELF/InputFiles.h
lld/ELF/InputSection.cpp
lld/ELF/Relocations.cpp