diff options
author | Fangrui Song <i@maskray.me> | 2021-12-22 21:11:25 -0800 |
---|---|---|
committer | Fangrui Song <i@maskray.me> | 2021-12-22 21:11:26 -0800 |
commit | d019de23a1d761225fdaf0c47394ba58143aea9a (patch) | |
tree | 96350a0c81bdb3901b6059e487d3cf0468f72203 /lld/ELF/SyntheticSections.cpp | |
parent | 5c75cc51b339e9c742ff5d1e88e330cdec88c983 (diff) | |
download | llvm-d019de23a1d761225fdaf0c47394ba58143aea9a.zip llvm-d019de23a1d761225fdaf0c47394ba58143aea9a.tar.gz llvm-d019de23a1d761225fdaf0c47394ba58143aea9a.tar.bz2 |
[ELF] Make InStruct members unique_ptr and remove associate make<XXX>
See D116143 for benefits. My lld executable (x86-64) is 24+KiB smaller.
Diffstat (limited to 'lld/ELF/SyntheticSections.cpp')
-rw-r--r-- | lld/ELF/SyntheticSections.cpp | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/lld/ELF/SyntheticSections.cpp b/lld/ELF/SyntheticSections.cpp index def06da2..047546e 100644 --- a/lld/ELF/SyntheticSections.cpp +++ b/lld/ELF/SyntheticSections.cpp @@ -1636,11 +1636,11 @@ void RelocationBaseSection::finalizeContents() { else getParent()->link = 0; - if (in.relaPlt == this && in.gotPlt->getParent()) { + if (in.relaPlt.get() == this && in.gotPlt->getParent()) { getParent()->flags |= ELF::SHF_INFO_LINK; getParent()->info = in.gotPlt->getParent()->sectionIndex; } - if (in.relaIplt == this && in.igotPlt->getParent()) { + if (in.relaIplt.get() == this && in.igotPlt->getParent()) { getParent()->flags |= ELF::SHF_INFO_LINK; getParent()->info = in.igotPlt->getParent()->sectionIndex; } @@ -3801,8 +3801,9 @@ void PartitionIndexSection::writeTo(uint8_t *buf) { write32(buf, mainPart->dynStrTab->getVA() + partitions[i].nameStrTab - va); write32(buf + 4, partitions[i].elfHeader->getVA() - (va + 4)); - SyntheticSection *next = - i == partitions.size() - 1 ? in.partEnd : partitions[i + 1].elfHeader; + SyntheticSection *next = i == partitions.size() - 1 + ? in.partEnd.get() + : partitions[i + 1].elfHeader; write32(buf + 8, next->getVA() - partitions[i].elfHeader->getVA()); va += 12; |