summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDodji Seketeli <dodji@redhat.com>2022-02-07 10:42:32 +0100
committerDodji Seketeli <dodji@redhat.com>2022-02-07 17:47:32 +0100
commit07f494aa460f86622a8796e072aff9ec4c6e39fb (patch)
treea81cc16f8974d8841e092da977dd5fb9156f75af
parentFind fts-standalone on musl (diff)
downloadlibabigail-07f494aa460f86622a8796e072aff9ec4c6e39fb.tar.gz
libabigail-07f494aa460f86622a8796e072aff9ec4c6e39fb.tar.bz2
libabigail-07f494aa460f86622a8796e072aff9ec4c6e39fb.tar.xz
symtab-reader: Remove an over-agressive assertion
In symtab::load, the symtab reader walks the symbol table and records each relation "symbol <-> address". So, the relation "foo <-> address-of-foo" is going to be recorded. The relation "foo.cfi <-> address-of-foo.cfi" is going to be recorded as well. But then, because the symbol foo.cfi has a special meaning, in the realm of "control flow integrity", the relation "foo.cfi <-> address-of-foo.cfi" (as well as all the *.cfi <-> address-of*.cfi relations) is going to be recorded (again but) in a particular way by calling symtab::add_alternative_address_lookups. The problem is that in, symtab::add_alternative_address_lookups there is an assert that (wrongly) assumes that the relation foo.cfi <-> address-of-foo.cfi is being seen for the first time. This is wrong because the loop in symtab::load that records all the "symbol <-> address" relations has seen and recorded this foo.cfi <-> address-of-foo.cfi relation once already. This patch removes that assert so that the kernel referred to in the bug report of PR26646, as mentioned in https://sourceware.org/bugzilla/show_bug.cgi?id=26646#c5, can be processed by abidw without crashing. * src/abg-symtab-reader.cc (symtab::add_alternative_address_lookups): Remove over-aggressive assert. Signed-off-by: Dodji Seketeli <dodji@redhat.com> Reviewed-by: Giuliano Procida <gprocida@google.com>
-rw-r--r--src/abg-symtab-reader.cc4
1 files changed, 1 insertions, 3 deletions
diff --git a/src/abg-symtab-reader.cc b/src/abg-symtab-reader.cc
index 78dec36d..b42ce87d 100644
--- a/src/abg-symtab-reader.cc
+++ b/src/abg-symtab-reader.cc
@@ -651,9 +651,7 @@ symtab::add_alternative_address_lookups(Elf* elf_handle)
651 symbol_sptr); 651 symbol_sptr);
652 } 652 }
653 653
654 const auto result = 654 addr_symbol_map_.emplace(symbol_value, symbol_sptr);
655 addr_symbol_map_.emplace(symbol_value, symbol_sptr);
656 ABG_ASSERT(result.second);
657 } 655 }
658 } 656 }
659 } 657 }