forked from OSchip/llvm-project
parent
d5a8efe733
commit
22c187be1d
|
@ -86,7 +86,8 @@ DynamicFile<ELFT>::create(std::unique_ptr<llvm::MemoryBuffer> mb,
|
|||
std::unique_ptr<DynamicFile> file(new DynamicFile(mb->getBufferIdentifier()));
|
||||
|
||||
std::error_code ec;
|
||||
file->_objFile.reset(new llvm::object::ELFFile<ELFT>(mb.release(), ec));
|
||||
file->_objFile.reset(
|
||||
new llvm::object::ELFFile<ELFT>(mb.release()->getBuffer(), ec));
|
||||
|
||||
if (ec)
|
||||
return ec;
|
||||
|
|
|
@ -410,7 +410,8 @@ ELFFile<ELFT>::create(std::unique_ptr<MemoryBuffer> mb, bool atomizeStrings) {
|
|||
std::unique_ptr<ELFFile<ELFT>> file(
|
||||
new ELFFile<ELFT>(mb->getBufferIdentifier(), atomizeStrings));
|
||||
|
||||
file->_objFile.reset(new llvm::object::ELFFile<ELFT>(mb.release(), ec));
|
||||
file->_objFile.reset(
|
||||
new llvm::object::ELFFile<ELFT>(mb.release()->getBuffer(), ec));
|
||||
|
||||
if (ec)
|
||||
return ec;
|
||||
|
|
|
@ -54,8 +54,8 @@ public:
|
|||
std::size_t maxAlignment =
|
||||
1ULL << llvm::countTrailingZeros(uintptr_t(mb->getBufferStart()));
|
||||
auto f = createELF<ELFFileCreateELFTraits>(
|
||||
llvm::object::getElfArchType(&*mb), maxAlignment, std::move(mb),
|
||||
_atomizeStrings);
|
||||
llvm::object::getElfArchType(mb->getBuffer()), maxAlignment,
|
||||
std::move(mb), _atomizeStrings);
|
||||
if (std::error_code ec = f.getError())
|
||||
return ec;
|
||||
result.push_back(std::move(*f));
|
||||
|
@ -81,8 +81,8 @@ public:
|
|||
std::size_t maxAlignment =
|
||||
1ULL << llvm::countTrailingZeros(uintptr_t(mb->getBufferStart()));
|
||||
auto f = createELF<DynamicFileCreateELFTraits>(
|
||||
llvm::object::getElfArchType(&*mb), maxAlignment, std::move(mb),
|
||||
_useUndefines);
|
||||
llvm::object::getElfArchType(mb->getBuffer()), maxAlignment,
|
||||
std::move(mb), _useUndefines);
|
||||
if (std::error_code ec = f.getError())
|
||||
return ec;
|
||||
result.push_back(std::move(*f));
|
||||
|
|
|
@ -127,7 +127,8 @@ public:
|
|||
std::unique_ptr<HexagonELFFile<ELFT>> file(
|
||||
new HexagonELFFile<ELFT>(mb->getBufferIdentifier(), atomizeStrings));
|
||||
|
||||
file->_objFile.reset(new llvm::object::ELFFile<ELFT>(mb.release(), ec));
|
||||
file->_objFile.reset(
|
||||
new llvm::object::ELFFile<ELFT>(mb.release()->getBuffer(), ec));
|
||||
|
||||
if (ec)
|
||||
return ec;
|
||||
|
|
|
@ -49,8 +49,8 @@ public:
|
|||
std::size_t maxAlignment =
|
||||
1ULL << llvm::countTrailingZeros(uintptr_t(mb->getBufferStart()));
|
||||
auto f = createELF<HexagonELFFileCreateELFTraits>(
|
||||
llvm::object::getElfArchType(&*mb), maxAlignment, std::move(mb),
|
||||
_atomizeStrings);
|
||||
llvm::object::getElfArchType(mb->getBuffer()), maxAlignment,
|
||||
std::move(mb), _atomizeStrings);
|
||||
if (std::error_code ec = f.getError())
|
||||
return ec;
|
||||
result.push_back(std::move(*f));
|
||||
|
@ -68,8 +68,8 @@ public:
|
|||
std::size_t maxAlignment =
|
||||
1ULL << llvm::countTrailingZeros(uintptr_t(mb->getBufferStart()));
|
||||
auto f = createELF<HexagonDynamicFileCreateELFTraits>(
|
||||
llvm::object::getElfArchType(&*mb), maxAlignment, std::move(mb),
|
||||
_useUndefines);
|
||||
llvm::object::getElfArchType(mb->getBuffer()), maxAlignment,
|
||||
std::move(mb), _useUndefines);
|
||||
if (std::error_code ec = f.getError())
|
||||
return ec;
|
||||
result.push_back(std::move(*f));
|
||||
|
|
|
@ -77,7 +77,8 @@ public:
|
|||
std::unique_ptr<MipsELFFile<ELFT>> file(
|
||||
new MipsELFFile<ELFT>(mb->getBufferIdentifier(), atomizeStrings));
|
||||
|
||||
file->_objFile.reset(new llvm::object::ELFFile<ELFT>(mb.release(), ec));
|
||||
file->_objFile.reset(
|
||||
new llvm::object::ELFFile<ELFT>(mb.release()->getBuffer(), ec));
|
||||
|
||||
if (ec)
|
||||
return ec;
|
||||
|
|
|
@ -35,8 +35,8 @@ public:
|
|||
std::size_t maxAlignment =
|
||||
1ULL << llvm::countTrailingZeros(uintptr_t(mb->getBufferStart()));
|
||||
auto f = createELF<MipsELFFileCreateTraits>(
|
||||
llvm::object::getElfArchType(&*mb), maxAlignment, std::move(mb),
|
||||
_atomizeStrings);
|
||||
llvm::object::getElfArchType(mb->getBuffer()), maxAlignment,
|
||||
std::move(mb), _atomizeStrings);
|
||||
if (std::error_code ec = f.getError())
|
||||
return ec;
|
||||
result.push_back(std::move(*f));
|
||||
|
|
Loading…
Reference in New Issue