[llvm] [ObjectYAML][ELF] Report incorrect offset to generate notes (PR #118741)
Igor Kudrin via llvm-commits
llvm-commits at lists.llvm.org
Thu Dec 5 15:11:13 PST 2024
igorkudrin wrote:
> I'm not sure I understand what the benefit is of adding this error to yaml2obj?
This helps to prevent the accidental generation of invalid note entries. If the current offset in `CBA` is not aligned as expected, the `namesz`, `descsz`, `type`, and `name` fields of the first entry would be aligned differently than its descriptor and all other note entries in the section, making the first entry malformed.
> With the error added, how would somebody generate a note section that wasn't correctly aligned?
At least, they can still use `Content:` instead of `Notes:`, or an empty array for `Notes:`.
https://github.com/llvm/llvm-project/pull/118741
More information about the llvm-commits
mailing list