Add support for dynamic relocations (code object v2.1)

Change-Id: Ic19be97d3ea78b53f5aa814787515b587d0be21b
This commit is contained in:
Konstantin Zhuravlyov
2016-05-25 15:41:31 -04:00
committed by Gerrit Code Review
parent a8b00680b6
commit 5a14d496ab
4 changed files with 174 additions and 51 deletions
@@ -1181,7 +1181,13 @@ namespace code {
void AmdHsaCode::PrintRelocationData(std::ostream& out, RelocationSection* section)
{
out << " Relocation Entries for " << section->targetSection()->Name() << " Section (total " << section->relocationCount() << "):" << std::endl;
if (section->targetSection()) {
out << " Relocation Entries for " << section->targetSection()->Name() << " Section (total " << section->relocationCount() << "):" << std::endl;
} else {
// Dynamic relocations do not have a target section, they work with
// virtual addresses.
out << " Dynamic Relocation Entries (total " << section->relocationCount() << "):" << std::endl;
}
for (size_t i = 0; i < section->relocationCount(); ++i) {
out << " Relocation (Index " << i << "):" << std::endl;
out << " Type: " << section->relocation(i)->type() << std::endl;