Skip to content
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

Ignore differences based on the number appended to function static symbols #175

Open
1superchip opened this issue Nov 16, 2024 · 1 comment

Comments

@1superchip
Copy link
Contributor

Function static symbols are appended with a number to prevent name collisions with other symbols with the same names.

asm-differ currently matches MWCC literals with the format of @num to any other symbol with the same format. The number appended to the name is internally generated by the compiler for both instances making the numbers irrelevant when matching code. Ignoring differences for function static symbols would make the symbol handling similar in both cases.

asm-differ currently flags the entire symbol as different when the number differs but the name is the same. Different compilers handle the symbol differently. GCC emits a . as the separator while MWCC emits a $.

MWCC: l_matDL$5761
image

GCC: cnt.1

I have not seen a great place to insert the code that compares 2 symbols to each other. It seems like the best place would be somewhere in https://github.com/simonlindholm/asm-differ/blob/main/diff.py#L3140. Any thoughts on where the code should be added?

@simonlindholm
Copy link
Owner

I have not seen a great place to insert the code that compares 2 symbols to each other. It seems like the best place would be somewhere in https://github.com/simonlindholm/asm-differ/blob/main/diff.py#L3140. Any thoughts on where the code should be added?

Yes, I think that's exactly the place to add it. Maybe and field_matches_any_symbol(nf, config.arch) could be and (field_matches_any_symbol(nf, config.arch) or ...)?

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

No branches or pull requests

2 participants