HashSize(HashSize) {
this->Live = true;
- Buf.resize(16 + HashSize);
+ Buf.resize(HeaderSize + HashSize);
const endianness E = ELFT::TargetEndianness;
write32<E>(Buf.data(), 4); // Name size
write32<E>(Buf.data() + 4, HashSize); // Content size
// Returns the location of the build-id hash value in the output.
template <class ELFT>
uint8_t *BuildIdSection<ELFT>::getOutputLoc(uint8_t *Start) const {
- // First 16 bytes are a header.
- return Start + this->OutSec->Offset + this->OutSecOff + 16;
+ return Start + this->OutSec->Offset + this->OutSecOff + HeaderSize;
}
// Split one uint8 array into small pieces of uint8 arrays.
std::function<void(ArrayRef<uint8_t> Arr, uint8_t *Hash)> Hash);
size_t HashSize;
+ // First 16 bytes are a header.
+ static const unsigned HeaderSize = 16;
};
template <class ELFT>