The Data member of MergeSyntheticSection, which is used by ICF to check
equality of section contents, is always empty. This can result in
incorrect and dangerous deduplication when using --icf=all and
--ignore-data-address-equality.
This simple fix populates the Data of MergeSyntheticSection with the
intended contents in finalizeContents and uses Data for writeTo.
Fixes bug PR36910.
At least clang is not finding an operator new[] to use. I had to manually call the Allocate function for this to build:
new (BAlloc.Allocate<uint8_t>(Size)) uint8_t[Size]
I guess we could also add new[] to Support/Allocator.h