NationalSecurityAgency / ghidra

Ghidra is a software reverse engineering (SRE) framework
https://www.nsa.gov/ghidra
Apache License 2.0
49.06k stars 5.65k forks source link

Ghdira unable to show TRICORE XREF with certain address registers #6626

Open CarbonCodeSystems opened 2 weeks ago

CarbonCodeSystems commented 2 weeks ago

With respects to the following code:

        a00da6ec d9 02 3e 59     lea        a2,[a0]-0x6e82
        a00da6f0 94 2f           ld.h       d15,[a2]=>DAT_d001117e                          
        a00da6f2 d9 02 18 5b     lea        a2,[a0]-0x4ea8
        a00da6f6 09 20 c0 08     ld.hu      d0,[a2]0x0=>DAT_d0013158                       
        a00da6fa d9 12 ae 7a     lea        a2,[a1]-0x5612
        a00da6fe 09 21 c0 08     ld.hu      d1,[a2]0x0=>DAT_a02029ee                         = 5271h
        a00da702 7f 01 0b 80     jge.u      d1,d0,LAB_a00da718
        a00da706 d9 12 86 aa     lea        a2=>DAT_a0202a86,[a1]-0x557a                     = 0040h

Ghidra is able to correctly display the XREF to the address referenced by the offset applied to [a1] at the bottom of the abovementioned code, however it is not able to do it for the case of the first instance. I am working on Tricore code, specifically TC179x.

Both instructions are load effective address yet it is only able to find the XREF on one of the instructions. This appears to be the case for much of the code, where Ghidra is correctly finding the XREF on many of the instructions, however it is missing the majority of them. I have correctly set the General Purpose Registers [a0], [a1], [a8] and [a9] for the context boundaries of the entire program. I have only noticed this issue on the current build I am using.

Thank you in advance for your guidance and assistance. ~ Josh

CarbonCodeSystems commented 2 weeks ago

I also wanted to add that this issue is persistent on the current build of Ghidra 11.1 - (as of 10 JUNE 24)