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

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


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

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`

>From 4b7c10a0dcad7a56dc8bcfee2a8314803e61d684 Mon Sep 17 00:00:00 2001
From: Daniil Kovalev <dkovalev at accesssoftek.com>
Date: Mon, 8 Jul 2024 17:19:45 +0300
Subject: [PATCH] [lld][ELF] Delete useless assertions

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`
---
 lld/ELF/SyntheticSections.cpp | 3 ---
 1 file changed, 3 deletions(-)

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;



More information about the llvm-commits mailing list