[ELF] Split EhInputSection::pieces into cies and fdes
authorFangrui Song <i@maskray.me>
Sun, 31 Jul 2022 23:16:10 +0000 (16:16 -0700)
committerFangrui Song <i@maskray.me>
Sun, 31 Jul 2022 23:16:10 +0000 (16:16 -0700)
commit3e9adff456213951376f6fff9349ffe71136f2b5
tree5d55cbd227715a0dea5bcbdd64aebec1f2fae911
parentbf6021709a4385e277e5e02eb7e1389a072b41f0
[ELF] Split EhInputSection::pieces into cies and fdes

This simplifies code, removes a read32 (for id==0 check), and makes it feasible
to combine some operations in EhInputSection::split and EhFrameSection::addRecords.

Mostly NFC, but fixes "Relocation not in any piece" assertion failure in an
erroneous case when a relocation offset precedes all CIE/FDE pices.
lld/ELF/InputSection.cpp
lld/ELF/InputSection.h
lld/ELF/MarkLive.cpp
lld/ELF/Relocations.cpp
lld/ELF/SyntheticSections.cpp