MCPcopy Create free account
hub / github.com/Kitware/CMake / EncodeDynamicEntries

Method EncodeDynamicEntries

Source/cmELF.cxx:540–561  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

538
539template <class Types>
540std::vector<char> cmELFInternalImpl<Types>::EncodeDynamicEntries(
541 cmELF::DynamicEntryList const& entries)
542{
543 std::vector<char> result;
544 result.reserve(sizeof(ELF_Dyn) * entries.size());
545
546 for (auto const& entry : entries) {
547 // Store the entry in an ELF_Dyn, byteswap it, then serialize to chars
548 ELF_Dyn dyn;
549 dyn.d_tag = static_cast<tagtype>(entry.first);
550 dyn.d_un.d_val = static_cast<tagtype>(entry.second);
551
552 if (this->NeedSwap) {
553 this->ByteSwap(dyn);
554 }
555
556 char* pdyn = reinterpret_cast<char*>(&dyn);
557 cm::append(result, pdyn, pdyn + sizeof(ELF_Dyn));
558 }
559
560 return result;
561}
562
563template <class Types>
564cmELF::StringEntry const* cmELFInternalImpl<Types>::GetDynamicSectionString(

Callers 2

LLVMFuzzerTestOneInputFunction · 0.80
RemoveRPathELFFunction · 0.80

Calls 5

ByteSwapMethod · 0.95
ValidMethod · 0.95
appendFunction · 0.85
reserveMethod · 0.80
sizeMethod · 0.45

Tested by

no test coverage detected