Skip to content

Commit e69c5d7

Browse files
veselypetaresistor
authored andcommitted
[CHERI] Remove DEBUG_CAP_(RELOCS/TABLE) options
1 parent e9cf3b2 commit e69c5d7

File tree

1 file changed

+0
-33
lines changed

1 file changed

+0
-33
lines changed

lld/ELF/Arch/Cheri.cpp

Lines changed: 0 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,6 @@ using namespace llvm;
1414
using namespace llvm::object;
1515
using namespace llvm::ELF;
1616

17-
// Change these to #define for extremely verbose debug output
18-
#undef DEBUG_CAP_RELOCS
19-
#undef DEBUG_CAP_TABLE
20-
2117
namespace lld {
2218
namespace elf {
2319

@@ -355,13 +351,6 @@ void CheriCapRelocsSection::addCapReloc(CheriCapRelocLocation loc,
355351
return; // Maybe happens with vtables?
356352
}
357353
if (targetNeedsDynReloc) {
358-
#ifdef DEBUG_CAP_RELOCS
359-
message("Adding dyn reloc at " + toString(this) + "+0x" +
360-
utohexstr(CurrentEntryOffset) + " against " +
361-
Target.verboseToString());
362-
message("Symbol preemptible:" + Twine(Target.Sym->IsPreemptible));
363-
#endif
364-
365354
bool relativeToLoadAddress = false;
366355
// The addend is not used as the offset into the capability here, as we
367356
// have the offset field in the __cap_relocs for that. The Addend
@@ -468,12 +457,6 @@ static uint64_t getTargetSize(Ctx &ctx, const CheriCapRelocLocation &location,
468457
// past the section
469458
if (offsetInOS <= os->size) {
470459
targetSize = os->size - offsetInOS;
471-
#ifdef DEBUG_CAP_RELOCS
472-
if (ctx.arg.verboseCapRelocs)
473-
errs() << " OS OFFSET 0x" << utohexstr(OS->Addr) << "SYM OFFSET 0x"
474-
<< utohexstr(OffsetInOS) << " SECLEN 0x" << utohexstr(OS->Size)
475-
<< " -> target size 0x" << utohexstr(TargetSize) << "\n";
476-
#endif
477460
UnknownSectionSize = false;
478461
}
479462
}
@@ -715,17 +698,6 @@ void CheriCapTableSection::addEntry(Symbol &sym, RelExpr expr,
715698
// TODO: should we emit two relocations instead?
716699
if (!idx.usedInCallExpr) it.first->second.usedInCallExpr = false;
717700
}
718-
#if defined(DEBUG_CAP_TABLE)
719-
std::string DbgContext;
720-
if (ctx.arg.CapTableScope == CapTableScopePolicy::File) {
721-
DbgContext = " for file '" + toString(IS->File) + "'";
722-
} else if (ctx.arg.CapTableScope == CapTableScopePolicy::Function) {
723-
DbgContext =
724-
" for function '" + toString(*findMatchingFunction(IS, Offset)) + "'";
725-
}
726-
llvm::errs() << "Added symbol " << toString(Sym) << " to .captable"
727-
<< DbgContext << ". Total count " << Entries.size() << "\n";
728-
#endif
729701
}
730702

731703
void CheriCapTableSection::addDynTlsEntry(Symbol &sym) {
@@ -755,11 +727,6 @@ uint32_t CheriCapTableSection::getIndex(const Symbol &sym,
755727
// start of the current captable subset (or the global table in the default
756728
// case). When using per-function tables the first index in every function
757729
// will always be zero.
758-
#if defined(DEBUG_CAP_TABLE)
759-
message("captable index for " + toString(Sym) + " is " +
760-
Twine(*it->second.Index) + " - " + Twine(Entries.FirstIndex) + ": " +
761-
Twine(*it->second.Index - Entries.FirstIndex));
762-
#endif
763730
return *it->second.index - entries.firstIndex;
764731
}
765732

0 commit comments

Comments
 (0)