[PATCH] D66426: [lld] Enable a watermark of loadable sections to be generated and placed in a note section

Fangrui Song via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Aug 20 08:48:12 PDT 2019


MaskRay added a comment.

Another problem is that .note.gnu.build-id is SHF_ALLOC and included in a PT_LOAD segment. When computing watermark, you probably don't want to include its contents. So you should compute build-id and watermark first before you write.

> By ensuring loadable sections have not changed since link-time, we can have confidence that they are compliant with the system ABI. This helps to ensure that changes to system software will not unexpectedly cause the ELF to execute incorrectly.

I think I want to hear a bit more about the motivation and how you'd use this feature. If this is used to measure ABI compliance, isn't it too strict? Different optimizations, adding/deleting .note* sections, shuffling .dynsym contents, linker -O1/-O2 (affecting SHF_MERGE sections), etc will change the watermark. Basically you can only do non-PT_LOAD-influencing things like upgrading linkers (lld has an embedded string in .comment), --discard-locals, --strip-debug, etc. I don't see how those things can help you share resources between two links.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D66426/new/

https://reviews.llvm.org/D66426





More information about the llvm-commits mailing list