BSD linker scripts contain special cases to add NOP padding to code sections. Syntax is next:
.init: { KEEP (*(.init)) } =0x90909090
(0x90 is NOP)
This patch implements that functionality.
Differential D17269
[ELF] - Implemented linkerscript sections padding. grimar on Feb 15 2016, 7:51 AM. Authored by
Details
Diff Detail Event Timeline
Comment Actions
|
I realized that I didn't actually understand what you said until now (because my approach should work and memcpy is the right way to copy filler to the section). You seems to misunderstand the feature.
If a filler is of the form 0x<hex digits>, then it is an arbitrary long sequence of hex digits. It is not a four byte value.
So this type needs to be std::vector<uint8_t>.