[lld] [lld][ELF] Delete useless assertions (PR #98028)

via llvm-commits llvm-commits at lists.llvm.org
Mon Jul 8 07:23:49 PDT 2024


llvmbot wrote:


<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-lld-elf

Author: Daniil Kovalev (kovdan01)

<details>
<summary>Changes</summary>

Assertions in the member functions below are considered not useful. See https://github.com/llvm/llvm-project/pull/96169#discussion_r1667181285

- `GotSection::addEntry`
- `GotSection::addTlsDescEntry`
- `GotSection::addDynTlsEntry`

---
Full diff: https://github.com/llvm/llvm-project/pull/98028.diff


1 Files Affected:

- (modified) lld/ELF/SyntheticSections.cpp (-3) 


``````````diff
diff --git a/lld/ELF/SyntheticSections.cpp b/lld/ELF/SyntheticSections.cpp
index 5d3f3df216b85..624dfd94ce8bf 100644
--- a/lld/ELF/SyntheticSections.cpp
+++ b/lld/ELF/SyntheticSections.cpp
@@ -653,19 +653,16 @@ GotSection::GotSection()
 
 void GotSection::addConstant(const Relocation &r) { relocations.push_back(r); }
 void GotSection::addEntry(const Symbol &sym) {
-  assert(sym.auxIdx == symAux.size() - 1);
   symAux.back().gotIdx = numEntries++;
 }
 
 bool GotSection::addTlsDescEntry(const Symbol &sym) {
-  assert(sym.auxIdx == symAux.size() - 1);
   symAux.back().tlsDescIdx = numEntries;
   numEntries += 2;
   return true;
 }
 
 bool GotSection::addDynTlsEntry(const Symbol &sym) {
-  assert(sym.auxIdx == symAux.size() - 1);
   symAux.back().tlsGdIdx = numEntries;
   // Global Dynamic TLS entries take two GOT slots.
   numEntries += 2;

``````````

</details>


https://github.com/llvm/llvm-project/pull/98028


More information about the llvm-commits mailing list