diff options
author | Fangrui Song <i@maskray.me> | 2021-12-27 17:05:48 -0800 |
---|---|---|
committer | Fangrui Song <i@maskray.me> | 2021-12-27 17:05:48 -0800 |
commit | 049cd480a0ce2f23c85ea12d24cc6ab6b535e764 (patch) | |
tree | 402ab77551038a88cbc58ad0a25b312ee6e823c9 /lld/ELF/SyntheticSections.cpp | |
parent | 8445883327b1383dc3c404922815b116a8d7dcb2 (diff) | |
download | llvm-049cd480a0ce2f23c85ea12d24cc6ab6b535e764.zip llvm-049cd480a0ce2f23c85ea12d24cc6ab6b535e764.tar.gz llvm-049cd480a0ce2f23c85ea12d24cc6ab6b535e764.tar.bz2 |
[ELF] Use const reference. NFC
Diffstat (limited to 'lld/ELF/SyntheticSections.cpp')
-rw-r--r-- | lld/ELF/SyntheticSections.cpp | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/lld/ELF/SyntheticSections.cpp b/lld/ELF/SyntheticSections.cpp index b3da9c7..797f381 100644 --- a/lld/ELF/SyntheticSections.cpp +++ b/lld/ELF/SyntheticSections.cpp @@ -1265,11 +1265,11 @@ DynamicSection<ELFT>::DynamicSection() // .rela.dyn // // DT_RELASZ is the total size of the included sections. -static uint64_t addRelaSz(RelocationBaseSection *relaDyn) { - size_t size = relaDyn->getSize(); - if (in.relaIplt->getParent() == relaDyn->getParent()) +static uint64_t addRelaSz(const RelocationBaseSection &relaDyn) { + size_t size = relaDyn.getSize(); + if (in.relaIplt->getParent() == relaDyn.getParent()) size += in.relaIplt->getSize(); - if (in.relaPlt->getParent() == relaDyn->getParent()) + if (in.relaPlt->getParent() == relaDyn.getParent()) size += in.relaPlt->getSize(); return size; } @@ -1375,7 +1375,8 @@ DynamicSection<ELFT>::computeContents() { (in.relaIplt->isNeeded() && part.relaDyn->getParent() == in.relaIplt->getParent())) { addInSec(part.relaDyn->dynamicTag, *part.relaDyn); - entries.emplace_back(part.relaDyn->sizeDynamicTag, addRelaSz(part.relaDyn)); + entries.emplace_back(part.relaDyn->sizeDynamicTag, + addRelaSz(*part.relaDyn)); bool isRela = config->isRela; addInt(isRela ? DT_RELAENT : DT_RELENT, |