MWCC literals are still matched together even when the addend is different
In some cases, literals can have addends (struct copies that generate literals). With the current implementation of https://github.com/simonlindholm/asm-differ/blob/main/diff.py#L3000, we only check if the symbol contains "@" without comparing the 2 symbols on both sides of the diff. Ideally, the addend should match between the target and current objects.
field_matches_any_symbol doesn't have the functionality to compare the left and right symbols of the diff. I am currently working on https://github.com/simonlindholm/asm-differ/issues/175 and am thinking that the solution I have for that issue may evolve to replace field_matches_any_symbol.
decomp.me scratch: https://decomp.me/scratch/9T6B6
I was writing: "For the MIPS case, https://github.com/simonlindholm/asm-differ/blob/main/diff.py#L3073 I think we could pull the regex result into a variable (while also changing the regex to capture the possible addend) and then check the addend.
%(?:hi|lo|gp_rel)\((@\d+(?:\+0x[A-Fa-f0-9]+)?)\) -> %(?:hi|lo|gp_rel)\((?:@\d+(\+0x[A-Fa-f0-9]+)?)\)"
But field_matches_any_symbol doesn't compare the left and right sides of the diff. Any ideas on how https://github.com/simonlindholm/asm-differ/blob/main/diff.py#L3217 could change to support field_matches_any_symbol and better symbol comparison?
For MWCC literals, we don't care about the number @12345 but we should care about the addend @9+0x10 != @3+0xC but @9+0x10 = @3+0x10. If both sides have the format @... and addends exist but do not match, the symbol does not match.