summaryrefslogtreecommitdiffstats
path: root/tester/covoar/ObjdumpProcessor.cc
diff options
context:
space:
mode:
authorAlex White <alex.white@oarcorp.com>2021-03-15 09:51:47 -0500
committerJoel Sherrill <joel@rtems.org>2021-03-30 13:15:58 -0500
commit7d14bb83e022801011c3af7578091917f4202fc5 (patch)
tree5f1294fef8987abdbeca5e6c3a48c8069994c27f /tester/covoar/ObjdumpProcessor.cc
parentcovoar: Fix DWARF reading (diff)
downloadrtems-tools-7d14bb83e022801011c3af7578091917f4202fc5.tar.bz2
covoar: Handle periods in symbols from objdump
Occasionally the compiler will generate symbols that look similar to symbols defined in RTEMS code except that they contain some suffix. These symbol suffixes are only found in the ELF symbol table; the symbols appear to be normal in the DWARF info. This appears to be happening on all architectures. For example, the function _Message_queue_Create from rtems appears as "_Message_queue_Create.part.0". Other suffixes include ".isra.0", ".constprop.0", and ".0". This looks to be related to compiler optimizations. Symbols with suffixes were being treated as unique. For our purposes, they should be mapped to the equivalent symbols in the DWARF info. This has been fixed.
Diffstat (limited to 'tester/covoar/ObjdumpProcessor.cc')
-rw-r--r--tester/covoar/ObjdumpProcessor.cc15
1 files changed, 15 insertions, 0 deletions
diff --git a/tester/covoar/ObjdumpProcessor.cc b/tester/covoar/ObjdumpProcessor.cc
index 05a50f1..16774d9 100644
--- a/tester/covoar/ObjdumpProcessor.cc
+++ b/tester/covoar/ObjdumpProcessor.cc
@@ -413,6 +413,21 @@ namespace Coverage {
processSymbol = false;
theInstructions.clear();
+ // Look for a '.' character and strip everything after it.
+ // There is a chance that the compiler splits function bodies to improve
+ // inlining. If there exists some inlinable function that contains a
+ // branch where one path is more expensive and less likely to be taken
+ // than the other, inlining only the branch instruction and the less
+ // expensive path results in smaller code size while preserving most of
+ // the performance improvement.
+ // When this happens, the compiler will generate a function with a
+ // ".part.n" suffix. For our purposes, this generated function part is
+ // equivalent to the original function and should be treated as such.
+ char *periodIndex = strstr(symbol, ".");
+ if (periodIndex != NULL) {
+ *periodIndex = 0;
+ }
+
// See if the new symbol is one that we care about.
if (SymbolsToAnalyze->isDesired( symbol )) {
currentSymbol = symbol;