Skip to content

Trim unnecessary trailing zeroes in data segments #1587

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from

Conversation

dcodeIO
Copy link
Member

@dcodeIO dcodeIO commented Dec 17, 2020

After #1586 it may not be that useful anymore to keep the exact contents of compiler-generated managed data segments in untouched output (for manual inspection), due to explicitly aligning up to the next valid block size and filling with even more zeroes than before. Perhaps trimming is more useful now?

  • I've read the contributing guidelines

Comment on lines +9 to +22
(data (i32.const 80) "")
(data (i32.const 96) "")
(data (i32.const 104) "")
(data (i32.const 108) "")
(data (i32.const 110) "")
(data (i32.const 111) "")
(data (i32.const 112) "")
(data (i32.const 128) "")
(data (i32.const 144) "")
(data (i32.const 152) "")
(data (i32.const 156) "")
(data (i32.const 158) "")
(data (i32.const 159) "")
(data (i32.const 160) "")
Copy link
Member

Choose a reason for hiding this comment

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

Could such empty data segments also avoided after trimming?

Copy link
Member Author

Choose a reason for hiding this comment

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

Hmm, good question. In this case we'd also lose the visual info that there is a data segment starting there. Still unsure how useful this or the zeroes are when manually viewing compiler output, somewhat depending on how common it is to run untouched binaries, and how far we'd like to go in terms of exactly displaying what becomes compiled.

Copy link
Member

Choose a reason for hiding this comment

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

Hmm, good question. In this case we'd also lose the visual info that there is a data segment starting there

Good point

@dcodeIO
Copy link
Member Author

dcodeIO commented Sep 4, 2021

Closing in favor of clarity.

@dcodeIO dcodeIO closed this Sep 4, 2021
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