Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[CHERI] Remove DEBUG_CAP_(RELOCS/TABLE) options #746

Open
wants to merge 1 commit into
base: dev
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 0 additions & 34 deletions lld/ELF/Arch/Cheri.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,6 @@ using namespace llvm;
using namespace llvm::object;
using namespace llvm::ELF;


// Change these to #define for extremely verbose debug output
#undef DEBUG_CAP_RELOCS
#undef DEBUG_CAP_TABLE

namespace lld {
namespace elf {

Expand Down Expand Up @@ -284,13 +279,6 @@ void CheriCapRelocsSection::addCapReloc(CheriCapRelocLocation loc,
return; // Maybe happens with vtables?
}
if (targetNeedsDynReloc) {
#ifdef DEBUG_CAP_RELOCS
message("Adding dyn reloc at " + toString(this) + "+0x" +
utohexstr(CurrentEntryOffset) + " against " +
Target.verboseToString());
message("Symbol preemptible:" + Twine(Target.Sym->IsPreemptible));
#endif

bool relativeToLoadAddress = false;
// The addend is not used as the offset into the capability here, as we
// have the offset field in the __cap_relocs for that. The Addend
Expand Down Expand Up @@ -397,12 +385,6 @@ static uint64_t getTargetSize(const CheriCapRelocLocation &location,
// Use less-or-equal here to account for __end_foo symbols which point 1 past the section
if (offsetInOS <= os->size) {
targetSize = os->size - offsetInOS;
#ifdef DEBUG_CAP_RELOCS
if (Config->verboseCapRelocs)
errs() << " OS OFFSET 0x" << utohexstr(OS->Addr) << "SYM OFFSET 0x"
<< utohexstr(OffsetInOS) << " SECLEN 0x" << utohexstr(OS->Size)
<< " -> target size 0x" << utohexstr(TargetSize) << "\n";
#endif
UnknownSectionSize = false;
}
}
Expand Down Expand Up @@ -632,16 +614,6 @@ void CheriCapTableSection::addEntry(Symbol &sym, RelExpr expr,
if (!idx.usedInCallExpr)
it.first->second.usedInCallExpr = false;
}
#if defined(DEBUG_CAP_TABLE)
std::string DbgContext;
if (Config->CapTableScope == CapTableScopePolicy::File) {
DbgContext = " for file '" + toString(IS->File) + "'";
} else if (Config->CapTableScope == CapTableScopePolicy::Function) {
DbgContext = " for function '" + toString(*findMatchingFunction(IS, Offset)) + "'";
}
llvm::errs() << "Added symbol " << toString(Sym) << " to .captable"
<< DbgContext << ". Total count " << Entries.size() << "\n";
#endif
}

void CheriCapTableSection::addDynTlsEntry(Symbol &sym) {
Expand Down Expand Up @@ -671,12 +643,6 @@ uint32_t CheriCapTableSection::getIndex(const Symbol &sym,
// start of the current captable subset (or the global table in the default
// case). When using per-function tables the first index in every function
// will always be zero.
#if defined(DEBUG_CAP_TABLE)
message("captable index for " + toString(Sym) + " is " +
Twine(*it->second.Index) + " - " +
Twine(Entries.FirstIndex) + ": " +
Twine(*it->second.Index - Entries.FirstIndex));
#endif
return *it->second.index - entries.firstIndex;
}

Expand Down
Loading