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

Change-Id: Ic19be97d3ea78b53f5aa814787515b587d0be21b


[ROCm/ROCR-Runtime commit: 5a14d496ab]
This commit is contained in:
Konstantin Zhuravlyov
2016-05-25 15:41:31 -04:00
committed by Gerrit Code Review
parent 76dea4613a
commit bf46c9e840
4 changed files with 174 additions and 51 deletions
@@ -1368,7 +1368,7 @@ namespace amd {
section = new GElfRelocationSection(this);
} else if (shdr.sh_type == SHT_STRTAB) {
section = new GElfStringTable(this);
} else if (shdr.sh_type == SHT_SYMTAB) {
} else if (shdr.sh_type == SHT_SYMTAB || shdr.sh_type == SHT_DYNSYM) {
section = new GElfSymbolTable(this);
} else if (shdr.sh_type == SHT_NULL) {
section = 0;
@@ -1391,14 +1391,14 @@ namespace amd {
for (size_t n = 1; n < sections.size(); ++n) {
GElfSection* section = sections[n].get();
if (section->type() == SHT_SYMTAB) {
if (section->type() == SHT_SYMTAB || section->type() == SHT_DYNSYM) {
if (!section->pullData()) { return false; }
}
}
for (size_t n = 1; n < sections.size(); ++n) {
GElfSection* section = sections[n].get();
if (section->type() != SHT_STRTAB && section->type() != SHT_SYMTAB) {
if (section->type() != SHT_STRTAB && section->type() != SHT_SYMTAB && section->type() != SHT_DYNSYM) {
if (!section->pullData()) { return false; }
}
}