I want to add a new section to an ELF file (say E) which stores the integrity hash of .text section. Assume I chunk the .text section into T1,T2..Tn and get the hash H1,H2..Hn and add all hashes to the E in a new .my_hash section.
One naive way to do this would be to
Any better way to do this?
Use objcopy --add-section. You may want --set-section-flags as well.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With