Replace private libelf with elfio
Change-Id: I4c630d78f7bf23dda85ec8480bb2790864405657
Этот коммит содержится в:
@@ -38,7 +38,7 @@ typedef struct {
|
||||
SymInfo[NDX_HEADER] : SymbolInfo for kernel header
|
||||
SymInfo[NDX_AMDIL] : SymbolInfo for kernel's amdil
|
||||
*/
|
||||
amd::OclElf::SymbolInfo SymInfo[NDX_LAST];
|
||||
amd::Elf::SymbolInfo SymInfo[NDX_LAST];
|
||||
} ElfSymbol_t;
|
||||
}
|
||||
|
||||
@@ -58,12 +58,12 @@ bool ClBinary::loadKernels(NullProgram& program, bool* hasRecompiled) {
|
||||
// Target should be 15 bit maximum. Should check this somewhere.
|
||||
uint32_t target = static_cast<uint32_t>(dev().calTarget());
|
||||
uint16_t elf_target;
|
||||
amd::OclElf::oclElfPlatform platform;
|
||||
amd::Elf::ElfPlatform platform;
|
||||
if (!elfIn()->getTarget(elf_target, platform)) {
|
||||
LogError("The OCL binary image loading failed: incorrect format");
|
||||
return false;
|
||||
}
|
||||
if (platform == amd::OclElf::COMPLIB_PLATFORM) {
|
||||
if (platform == amd::Elf::COMPLIB_PLATFORM) {
|
||||
// BIF 3.0
|
||||
uint32_t flag;
|
||||
aclTargetInfo tgtInfo = aclGetTargetInfo("amdil", dev().hwInfo()->targetName_, NULL);
|
||||
@@ -76,7 +76,7 @@ bool ClBinary::loadKernels(NullProgram& program, bool* hasRecompiled) {
|
||||
return false;
|
||||
}
|
||||
} else {
|
||||
if (((platform != amd::OclElf::CAL_PLATFORM) || ((uint32_t)target != elf_target))) {
|
||||
if (((platform != amd::Elf::CAL_PLATFORM) || ((uint32_t)target != elf_target))) {
|
||||
LogError("The OCL binary image loading failed: different target");
|
||||
return false;
|
||||
}
|
||||
@@ -109,10 +109,10 @@ bool ClBinary::loadKernels(NullProgram& program, bool* hasRecompiled) {
|
||||
*/
|
||||
bool usedebugil = program.getCompilerOptions()->oVariables->UseDebugIL;
|
||||
|
||||
for (amd::Sym_Handle sym = elfIn()->nextSymbol(NULL); sym != NULL;
|
||||
sym = elfIn()->nextSymbol(sym)) {
|
||||
amd::OclElf::SymbolInfo symInfo;
|
||||
if (!elfIn()->getSymbolInfo(sym, &symInfo)) {
|
||||
int num = elfIn()->getSymbolNum();
|
||||
for (int index = 0; index < num; index++) {
|
||||
amd::Elf::SymbolInfo symInfo;
|
||||
if (!elfIn()->getSymbolInfo(index, &symInfo)) {
|
||||
LogError("LoadKernelFromElf: getSymbolInfo() fails");
|
||||
return false;
|
||||
}
|
||||
@@ -131,7 +131,7 @@ bool ClBinary::loadKernels(NullProgram& program, bool* hasRecompiled) {
|
||||
FName.append("_kernel"); // make the kernel's linkage name
|
||||
|
||||
ElfSymbol_t* elfsymbol = tempObj.functionNameMap[FName];
|
||||
amd::OclElf::SymbolInfo* sinfo = (elfsymbol != NULL) ? &(elfsymbol->SymInfo[0]) : NULL;
|
||||
amd::Elf::SymbolInfo* sinfo = (elfsymbol != NULL) ? &(elfsymbol->SymInfo[0]) : NULL;
|
||||
|
||||
// Add info for this elf symbol into tempobj's functionNameMap[]
|
||||
int index = -1;
|
||||
@@ -168,7 +168,6 @@ bool ClBinary::loadKernels(NullProgram& program, bool* hasRecompiled) {
|
||||
if (elfsymbol == NULL) {
|
||||
elfsymbol = new ElfSymbol_t();
|
||||
sinfo = &(elfsymbol->SymInfo[0]);
|
||||
::memset(sinfo, 0, NDX_LAST * sizeof(amd::OclElf::SymbolInfo));
|
||||
tempObj.functionNameMap[FName] = elfsymbol;
|
||||
|
||||
elfsymbol->IsKernel = isKernel;
|
||||
@@ -182,7 +181,7 @@ bool ClBinary::loadKernels(NullProgram& program, bool* hasRecompiled) {
|
||||
char* section;
|
||||
size_t sz;
|
||||
|
||||
if (elfIn_->getSection(amd::OclElf::ILDEBUG, §ion, &sz)) {
|
||||
if (elfIn_->getSection(amd::Elf::ILDEBUG, §ion, &sz)) {
|
||||
// Get debugIL
|
||||
programil.append(section, sz);
|
||||
} else {
|
||||
@@ -221,10 +220,9 @@ bool ClBinary::loadKernels(NullProgram& program, bool* hasRecompiled) {
|
||||
ElfSymbol_t* elfsymbol = tempObj.functionNameMap[kn];
|
||||
if (elfsymbol == NULL) {
|
||||
elfsymbol = new ElfSymbol_t();
|
||||
::memset(elfsymbol->SymInfo, 0, NDX_LAST * sizeof(amd::OclElf::SymbolInfo));
|
||||
tempObj.functionNameMap[kn] = elfsymbol;
|
||||
}
|
||||
amd::OclElf::SymbolInfo* sinfo = &(elfsymbol->SymInfo[0]);
|
||||
amd::Elf::SymbolInfo* sinfo = &(elfsymbol->SymInfo[0]);
|
||||
|
||||
elfsymbol->IsKernel = true;
|
||||
sinfo[NDX_AMDIL].address = const_cast<char*>(ilstr.data());
|
||||
@@ -248,7 +246,7 @@ bool ClBinary::loadKernels(NullProgram& program, bool* hasRecompiled) {
|
||||
fmetadata.append(it.first);
|
||||
fmetadata.append("_fmetadata");
|
||||
|
||||
if (!elfOut()->addSymbol(amd::OclElf::RODATA, fmetadata.c_str(),
|
||||
if (!elfOut()->addSymbol(amd::Elf::RODATA, fmetadata.c_str(),
|
||||
elfsymbol->SymInfo[NDX_METADATA].address,
|
||||
elfsymbol->SymInfo[NDX_METADATA].size)) {
|
||||
LogError("AddSymbol() failed to add fmetadata");
|
||||
@@ -257,7 +255,7 @@ bool ClBinary::loadKernels(NullProgram& program, bool* hasRecompiled) {
|
||||
}
|
||||
continue;
|
||||
}
|
||||
amd::OclElf::SymbolInfo* sinfo = &(elfsymbol->SymInfo[0]);
|
||||
amd::Elf::SymbolInfo* sinfo = &(elfsymbol->SymInfo[0]);
|
||||
std::string FName = it.first;
|
||||
|
||||
// For this kernel, get the demangled kernel name, which is used to identify each kernel.
|
||||
@@ -297,7 +295,7 @@ bool ClBinary::loadKernels(NullProgram& program, bool* hasRecompiled) {
|
||||
}
|
||||
|
||||
assert((func->metadata_.end_ == 0) && "ILFunc init failed");
|
||||
amd::OclElf::SymbolInfo* si = &(sym->SymInfo[0]);
|
||||
amd::Elf::SymbolInfo* si = &(sym->SymInfo[0]);
|
||||
if (si[NDX_METADATA].size > 0) {
|
||||
std::string meta(si[NDX_METADATA].address, si[NDX_METADATA].size);
|
||||
if (!program.parseFuncMetadata(meta, 0, std::string::npos)) {
|
||||
@@ -383,7 +381,7 @@ bool ClBinary::storeKernel(const std::string& name, const NullKernel* nullKernel
|
||||
if (saveAMDIL() && (ilSource.size() > 0)) {
|
||||
// Save IL (this is the per-kernel IL)
|
||||
std::string ilName = "__OpenCL_" + name + "_amdil";
|
||||
if (!elfOut()->addSymbol(amd::OclElf::ILTEXT, ilName.c_str(), ilSource.data(),
|
||||
if (!elfOut()->addSymbol(amd::Elf::ILTEXT, ilName.c_str(), ilSource.data(),
|
||||
ilSource.size())) {
|
||||
LogError("AddElfSymbol failed");
|
||||
return false;
|
||||
@@ -391,7 +389,7 @@ bool ClBinary::storeKernel(const std::string& name, const NullKernel* nullKernel
|
||||
|
||||
std::string metaName = "__OpenCL_" + name + "_metadata";
|
||||
// Save metadata symbols in .rodata
|
||||
if (!elfOut()->addSymbol(amd::OclElf::RODATA, metaName.c_str(), metadata.data(),
|
||||
if (!elfOut()->addSymbol(amd::Elf::RODATA, metaName.c_str(), metadata.data(),
|
||||
metadata.size())) {
|
||||
LogError("AddElfSymbol failed");
|
||||
return false;
|
||||
@@ -408,7 +406,7 @@ bool ClBinary::storeKernel(const std::string& name, const NullKernel* nullKernel
|
||||
if (!kernelMetaStored) {
|
||||
std::string metaName = "__OpenCL_" + name + "_metadata";
|
||||
// Save metadata symbols in .rodata
|
||||
if (!elfOut()->addSymbol(amd::OclElf::RODATA, metaName.c_str(), metadata.data(),
|
||||
if (!elfOut()->addSymbol(amd::Elf::RODATA, metaName.c_str(), metadata.data(),
|
||||
metadata.size())) {
|
||||
LogError("AddSymbol failed");
|
||||
return false;
|
||||
@@ -422,7 +420,7 @@ bool ClBinary::storeKernel(const std::string& name, const NullKernel* nullKernel
|
||||
delete[] isacode;
|
||||
return false;
|
||||
}
|
||||
if (!elfOut()->addSymbol(amd::OclElf::CAL, kernelName.c_str(), isacode, binarySize)) {
|
||||
if (!elfOut()->addSymbol(amd::Elf::CAL, kernelName.c_str(), isacode, binarySize)) {
|
||||
LogError("AddElfSymbol failed");
|
||||
return false;
|
||||
}
|
||||
@@ -446,7 +444,7 @@ bool ClBinary::storeKernel(const std::string& name, const NullKernel* nullKernel
|
||||
// VERSION_1
|
||||
kHeader.version_ = VERSION_CURRENT;
|
||||
|
||||
if (!elfOut()->addSymbol(amd::OclElf::RODATA, headerName.c_str(), &kHeader, sizeof(kHeader))) {
|
||||
if (!elfOut()->addSymbol(amd::Elf::RODATA, headerName.c_str(), &kHeader, sizeof(kHeader))) {
|
||||
LogError("AddElfSymbol failed");
|
||||
return false;
|
||||
}
|
||||
@@ -458,10 +456,10 @@ bool ClBinary::loadGlobalData(Program& program) {
|
||||
const char __OpenCL_[] = "__OpenCL_";
|
||||
const char _global[] = "_global";
|
||||
|
||||
for (amd::Sym_Handle sym = elfIn()->nextSymbol(NULL); sym != NULL;
|
||||
sym = elfIn()->nextSymbol(sym)) {
|
||||
amd::OclElf::SymbolInfo symInfo;
|
||||
if (!elfIn()->getSymbolInfo(sym, &symInfo)) {
|
||||
int num = elfIn()->getSymbolNum();
|
||||
for (int index = 0; index < num; index++) {
|
||||
amd::Elf::SymbolInfo symInfo;
|
||||
if (!elfIn()->getSymbolInfo(index, &symInfo)) {
|
||||
LogError("LoadGlobalDataFromElf: getSymbolInfo() fails");
|
||||
return false;
|
||||
}
|
||||
@@ -495,7 +493,7 @@ bool ClBinary::storeGlobalData(const void* globalData, size_t dataSize, uint ind
|
||||
std::stringstream glbName;
|
||||
glbName << "__OpenCL_" << index << "_global";
|
||||
|
||||
if (!elfOut()->addSymbol(amd::OclElf::RODATA, glbName.str().c_str(), globalData, dataSize)) {
|
||||
if (!elfOut()->addSymbol(amd::Elf::RODATA, glbName.str().c_str(), globalData, dataSize)) {
|
||||
LogError("addSymbol() failed");
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -92,7 +92,7 @@ class ClBinary : public device::ClBinary {
|
||||
uint32_t target = static_cast<uint32_t>(dev().calTarget());
|
||||
assert(((0xFFFF8000 & target) == 0) && "ASIC target ID >= 2^15");
|
||||
uint16_t elf_target = (uint16_t)(0x7FFF & target);
|
||||
return elfOut()->setTarget(elf_target, amd::OclElf::CAL_PLATFORM);
|
||||
return elfOut()->setTarget(elf_target, amd::Elf::CAL_PLATFORM);
|
||||
}
|
||||
|
||||
//! Clear elf out.
|
||||
|
||||
@@ -226,7 +226,7 @@ bool NullProgram::compileImpl(const std::string& src,
|
||||
}
|
||||
|
||||
llvmBinary_.assign(reinterpret_cast<const char*>(ir), len);
|
||||
elfSectionType_ = amd::OclElf::LLVMIR;
|
||||
elfSectionType_ = amd::Elf::LLVMIR;
|
||||
aclBinaryFini(bin);
|
||||
|
||||
for (size_t i = 0; i < headerFileNames.size(); ++i) {
|
||||
@@ -241,10 +241,10 @@ bool NullProgram::compileImpl(const std::string& src,
|
||||
#endif
|
||||
|
||||
if (clBinary()->saveSOURCE()) {
|
||||
clBinary()->elfOut()->addSection(amd::OclElf::SOURCE, sourceCode.data(), sourceCode.size());
|
||||
clBinary()->elfOut()->addSection(amd::Elf::SOURCE, sourceCode.data(), sourceCode.size());
|
||||
}
|
||||
if (clBinary()->saveLLVMIR()) {
|
||||
clBinary()->elfOut()->addSection(amd::OclElf::LLVMIR, llvmBinary_.data(), llvmBinary_.size(),
|
||||
clBinary()->elfOut()->addSection(amd::Elf::LLVMIR, llvmBinary_.data(), llvmBinary_.size(),
|
||||
false);
|
||||
// store the original compile options
|
||||
clBinary()->storeCompileOptions(compileOptions_);
|
||||
@@ -272,11 +272,11 @@ int NullProgram::compileBinaryToIL(amd::option::Options* options) {
|
||||
aclSections_0_8 spirFlag;
|
||||
_acl_type_enum_0_8 aclTypeBinaryUsed;
|
||||
if (std::string::npos != options->clcOptions.find("--spirv") ||
|
||||
elfSectionType_ == amd::OclElf::SPIRV) {
|
||||
elfSectionType_ == amd::Elf::SPIRV) {
|
||||
spirFlag = aclSPIRV;
|
||||
aclTypeBinaryUsed = ACL_TYPE_SPIRV_BINARY;
|
||||
} else if (std::string::npos != options->clcOptions.find("--spir") ||
|
||||
elfSectionType_ == amd::OclElf::SPIR) {
|
||||
elfSectionType_ == amd::Elf::SPIR) {
|
||||
spirFlag = aclSPIR;
|
||||
aclTypeBinaryUsed = ACL_TYPE_SPIR_BINARY;
|
||||
} else {
|
||||
|
||||
@@ -169,8 +169,8 @@ bool NullProgram::linkImpl(amd::option::Options* options) {
|
||||
char* section;
|
||||
size_t sz;
|
||||
if (clBinary()->saveSOURCE() &&
|
||||
clBinary()->elfIn()->getSection(amd::OclElf::SOURCE, §ion, &sz)) {
|
||||
clBinary()->elfOut()->addSection(amd::OclElf::SOURCE, section, sz);
|
||||
clBinary()->elfIn()->getSection(amd::Elf::SOURCE, §ion, &sz)) {
|
||||
clBinary()->elfOut()->addSection(amd::Elf::SOURCE, section, sz);
|
||||
}
|
||||
if (clBinary()->saveLLVMIR()) {
|
||||
if (clBinary()->loadLlvmBinary(llvmBinary_, elfSectionType_) &&
|
||||
@@ -193,7 +193,7 @@ bool NullProgram::linkImpl(amd::option::Options* options) {
|
||||
}
|
||||
return true;
|
||||
} else if (clBinary()->loadLlvmBinary(llvmBinary_, elfSectionType_) &&
|
||||
clBinary()->isRecompilable(llvmBinary_, amd::OclElf::CAL_PLATFORM)) {
|
||||
clBinary()->isRecompilable(llvmBinary_, amd::Elf::CAL_PLATFORM)) {
|
||||
char* section;
|
||||
size_t sz;
|
||||
|
||||
@@ -205,8 +205,8 @@ bool NullProgram::linkImpl(amd::option::Options* options) {
|
||||
}
|
||||
|
||||
if (clBinary()->saveSOURCE() &&
|
||||
clBinary()->elfIn()->getSection(amd::OclElf::SOURCE, §ion, &sz)) {
|
||||
clBinary()->elfOut()->addSection(amd::OclElf::SOURCE, section, sz);
|
||||
clBinary()->elfIn()->getSection(amd::Elf::SOURCE, §ion, &sz)) {
|
||||
clBinary()->elfOut()->addSection(amd::Elf::SOURCE, section, sz);
|
||||
}
|
||||
if (clBinary()->saveLLVMIR()) {
|
||||
clBinary()->elfOut()->addSection(elfSectionType_, llvmBinary_.data(), llvmBinary_.size(),
|
||||
@@ -239,7 +239,7 @@ bool NullProgram::linkImpl(amd::option::Options* options) {
|
||||
size_t dbgSize = debugILStr.size();
|
||||
// Add an IL section that contains debug information and is the
|
||||
// output of LLVM codegen.
|
||||
clBinary()->elfOut()->addSection(amd::OclElf::ILDEBUG, dbgSec, dbgSize);
|
||||
clBinary()->elfOut()->addSection(amd::Elf::ILDEBUG, dbgSec, dbgSize);
|
||||
|
||||
if ((dbgSize > 0) && options->isDumpFlagSet(amd::option::DUMP_DEBUGIL)) {
|
||||
std::string debugilWithLine;
|
||||
@@ -275,7 +275,7 @@ bool NullProgram::linkImpl(amd::option::Options* options) {
|
||||
continue;
|
||||
}
|
||||
clBinary()->elfOut()->addSection(
|
||||
static_cast<amd::OclElf::oclElfSections>(x + amd::OclElf::DEBUG_INFO), dbgSec, dbgSize);
|
||||
static_cast<amd::Elf::ElfSections>(x + amd::Elf::DEBUG_INFO), dbgSec, dbgSize);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -410,7 +410,7 @@ bool NullProgram::linkImpl(amd::option::Options* options) {
|
||||
aStream << "__OpenCL_" << baseFunc->name_ << "_fmetadata";
|
||||
std::string metaName = aStream.str();
|
||||
// Save metadata symbols in .rodata
|
||||
if (!clBinary()->elfOut()->addSymbol(amd::OclElf::RODATA, metaName.c_str(),
|
||||
if (!clBinary()->elfOut()->addSymbol(amd::Elf::RODATA, metaName.c_str(),
|
||||
metadataStr.data(), metadataStr.size())) {
|
||||
buildLog_ += "Internal error: addSymbol failed!\n";
|
||||
LogError("AddSymbol failed");
|
||||
@@ -437,7 +437,7 @@ bool NullProgram::linkImpl(amd::option::Options* options) {
|
||||
bool NullProgram::linkImpl(const std::vector<device::Program*>& inputPrograms,
|
||||
amd::option::Options* options, bool createLibrary) {
|
||||
std::vector<std::string*> llvmBinaries(inputPrograms.size());
|
||||
std::vector<amd::OclElf::oclElfSections> elfSectionType(inputPrograms.size());
|
||||
std::vector<amd::Elf::ElfSections> elfSectionType(inputPrograms.size());
|
||||
auto it = inputPrograms.cbegin();
|
||||
const auto itEnd = inputPrograms.cend();
|
||||
for (size_t i = 0; it != itEnd; ++it, ++i) {
|
||||
@@ -464,7 +464,7 @@ bool NullProgram::linkImpl(const std::vector<device::Program*>& inputPrograms,
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!program->clBinary()->isRecompilable(program->llvmBinary_, amd::OclElf::CAL_PLATFORM)) {
|
||||
if (!program->clBinary()->isRecompilable(program->llvmBinary_, amd::Elf::CAL_PLATFORM)) {
|
||||
buildLog_ +=
|
||||
"Internal error: Input OpenCL binary is not"
|
||||
" for the target!\n";
|
||||
@@ -477,8 +477,8 @@ bool NullProgram::linkImpl(const std::vector<device::Program*>& inputPrograms,
|
||||
size_t sz;
|
||||
|
||||
if (clBinary()->saveSOURCE() &&
|
||||
clBinary()->elfIn()->getSection(amd::OclElf::SOURCE, §ion, &sz)) {
|
||||
clBinary()->elfOut()->addSection(amd::OclElf::SOURCE, section, sz);
|
||||
clBinary()->elfIn()->getSection(amd::Elf::SOURCE, §ion, &sz)) {
|
||||
clBinary()->elfOut()->addSection(amd::Elf::SOURCE, section, sz);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
@@ -505,9 +505,9 @@ bool NullProgram::linkImpl(const std::vector<device::Program*>& inputPrograms,
|
||||
}
|
||||
|
||||
_bif_sections_enum_0_8 aclTypeUsed;
|
||||
if (elfSectionType[i] == amd::OclElf::SPIRV) {
|
||||
if (elfSectionType[i] == amd::Elf::SPIRV) {
|
||||
aclTypeUsed = aclSPIRV;
|
||||
} else if (elfSectionType[i] == amd::OclElf::SPIR) {
|
||||
} else if (elfSectionType[i] == amd::Elf::SPIR) {
|
||||
aclTypeUsed = aclSPIR;
|
||||
} else {
|
||||
aclTypeUsed = aclLLVMIR;
|
||||
@@ -542,9 +542,9 @@ bool NullProgram::linkImpl(const std::vector<device::Program*>& inputPrograms,
|
||||
|
||||
size_t size = 0;
|
||||
_bif_sections_enum_0_8 aclTypeUsed;
|
||||
if (elfSectionType[0] == amd::OclElf::SPIRV && numLibs == 0) {
|
||||
if (elfSectionType[0] == amd::Elf::SPIRV && numLibs == 0) {
|
||||
aclTypeUsed = aclSPIRV;
|
||||
} else if (elfSectionType[0] == amd::OclElf::SPIR && numLibs == 0) {
|
||||
} else if (elfSectionType[0] == amd::Elf::SPIR && numLibs == 0) {
|
||||
aclTypeUsed = aclSPIR;
|
||||
} else {
|
||||
aclTypeUsed = aclLLVMIR;
|
||||
@@ -556,7 +556,7 @@ bool NullProgram::linkImpl(const std::vector<device::Program*>& inputPrograms,
|
||||
}
|
||||
|
||||
llvmBinary_.assign(reinterpret_cast<const char*>(llvmir), size);
|
||||
elfSectionType_ = amd::OclElf::LLVMIR;
|
||||
elfSectionType_ = amd::Elf::LLVMIR;
|
||||
} while (0);
|
||||
|
||||
std::for_each(libs.begin(), libs.end(), std::ptr_fun(aclBinaryFini));
|
||||
@@ -567,7 +567,7 @@ bool NullProgram::linkImpl(const std::vector<device::Program*>& inputPrograms,
|
||||
}
|
||||
|
||||
if (clBinary()->saveLLVMIR()) {
|
||||
clBinary()->elfOut()->addSection(amd::OclElf::LLVMIR, llvmBinary_.data(), llvmBinary_.size(),
|
||||
clBinary()->elfOut()->addSection(amd::Elf::LLVMIR, llvmBinary_.data(), llvmBinary_.size(),
|
||||
false);
|
||||
// store the original link options
|
||||
clBinary()->storeLinkOptions(linkOptions_);
|
||||
@@ -603,7 +603,7 @@ bool NullProgram::linkImpl(const std::vector<device::Program*>& inputPrograms,
|
||||
size_t dbgSize = debugILStr.size();
|
||||
// Add an IL section that contains debug information and is the
|
||||
// output of LLVM codegen.
|
||||
clBinary()->elfOut()->addSection(amd::OclElf::ILDEBUG, dbgSec, dbgSize);
|
||||
clBinary()->elfOut()->addSection(amd::Elf::ILDEBUG, dbgSec, dbgSize);
|
||||
|
||||
if ((dbgSize > 0) && options->isDumpFlagSet(amd::option::DUMP_DEBUGIL)) {
|
||||
std::string debugilWithLine;
|
||||
@@ -639,7 +639,7 @@ bool NullProgram::linkImpl(const std::vector<device::Program*>& inputPrograms,
|
||||
continue;
|
||||
}
|
||||
clBinary()->elfOut()->addSection(
|
||||
static_cast<amd::OclElf::oclElfSections>(x + amd::OclElf::DEBUG_INFO), dbgSec, dbgSize);
|
||||
static_cast<amd::Elf::ElfSections>(x + amd::Elf::DEBUG_INFO), dbgSec, dbgSize);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -774,7 +774,7 @@ bool NullProgram::linkImpl(const std::vector<device::Program*>& inputPrograms,
|
||||
aStream << "__OpenCL_" << baseFunc->name_ << "_fmetadata";
|
||||
std::string metaName = aStream.str();
|
||||
// Save metadata symbols in .rodata
|
||||
if (!clBinary()->elfOut()->addSymbol(amd::OclElf::RODATA, metaName.c_str(),
|
||||
if (!clBinary()->elfOut()->addSymbol(amd::Elf::RODATA, metaName.c_str(),
|
||||
metadataStr.data(), metadataStr.size())) {
|
||||
buildLog_ += "Internal error: addSymbol failed!\n";
|
||||
LogError("AddSymbol failed");
|
||||
|
||||
Ссылка в новой задаче
Block a user