Relate Bin file (read from uC) to map file

We have a AT32UC3C1512 presenting a Failure, part of the analysis that is normally performed to isolate the failure is to perform ABA swap of components, we have performed the swap in several components in the board and the failure follows the microcontroller.

The next step is to perform a verification of the firmware in the uC, we have a "master" bin file that is programmed via avr-gcc (in the production floor) and we use that to perform a verification, the verification was failed by the microcontroller, so we extracted the faulty microcontroller flash memory file and perform a comparation using HxD, there are 2 sections that have corrupted data.

I have the .map file of the compiled project. I was wondering if there is a way to obtain the address of the corrupted data from the BIN file to compare against the map file to see in which function or what variables/sections are being the ones throwing the error.

Any ideas? Thank you :)

Read back the image from failed MCU (read couple of times if you are not sure if the chip is okay). Then convert the .bin files to Intel Hex (for example: srec_cat input.bin -Binary -Output output.hex -Intel --line_length=44) and use any text diff tool to spot the differences. Addresses are obviously visible in Intel Hex files. Then you can just search the map file for a particular address.