In the firmware I am reversing (for a 16-bit MCU), there is code that copies the code of a function from flash memory to RAM, then jumps to it for execution:
F000:FEFF : mmap'ed location of function code in flash memory 2400:32FF : RAM location where the function code is copied
Inside said copied function, there are absolute jmps, such as:
The operand is the absolute address 2838. Unfortunately, in the disassembly, this address is in the RAM area and it contains only 0s obviously. The corresponding code in the flash area of the disassembly is at F438 (F000 + 2838-2400 = F000 + 438). Is there a way to apply a jmp target correction so that IDA understands that the target code of the jump is F438 instead of 2838?
This would correct the XREFs, repeatable comments and would make navigation easier. It would be nice also if there was a mechanism to correct all absolute references in a section of code, but I don't mind correcting all absolute references manually.
One thing that wasn't clear in my question is that there are both absolute and relative references in the block of code copied to RAM. Therefore, creating a segment with a different base to encompass that code would not work since it would correct the absolute references, and break the relative references.