Skip to content

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

Description

@1superchip

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?

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions