Skip to content

Conversation

@feedab1e
Copy link
Contributor

Split from #258, this PR adds additional rules for validation of object files to ensure that invalid relocations are not present in a valid object file.

@feedab1e feedab1e requested a review from sbc100 October 21, 2025 20:22
If a data encoding for the relocation cannot be determined (i.e. there isn't a
known grammar construct at the relocation offset), the data encoding constraints
aren't applied. For example, this is the case for unknown custom sections and
data segments.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would it be simpler to say that all the above restriction apply only the code secition?

I'm a little confused seeing "the data encoding constraints
aren't applied. For example, this is the case for unknown custom sections and
data segments." above and "In the CODE section, only certain .." below.

In all cases aren't all the limitations limited to the code section?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, there may be custom section relocations for which the assembler may be aware of the relocation formats. If, for example, we were to validate DWARF, we would also like to validate that the relocations there are valid too.

@sbc100 sbc100 merged commit 47f151f into WebAssembly:main Oct 22, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants