This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

How to make the arm linker decompress the second correctly with "RW data compression"?

title: How to make the arm linker decompress the second load region while both 1st and 2nd region are applied "RW data compression"?

I got a below scatter file (a simple version of my complex scatter file)

LOAD_REGION_01 0x0
{
   EXECUTION_REGION_01  0x0
   {
      ABC.o (+RO,+RW)
   }
}

LOAD_REGION_02 0x0
{
   EXECUTION_REGION_02  0x100
   {
      DEF.o (+RO,+RW)
   }
}

The RW data compression is applied automatically and I got a binary with size 0x40 (0x20 for LOAD_REGION_01 and 0x20 for LOAD_REGION_02 ), the got a link.info as following MAP file.

 Load Region LOAD_REGION_01 (Base: 0x0, Size: 0x30, Max: 0x000000a0, ABSOLUTE)

    Execution Region EXECUTION_REGION_01 (Base:0x0,Size:0x30,Max:0xffffffff,ABSOLUTE, COMPRESSED[0x20])


 Load Region LOAD_REGION_02 (Base: 0x30, Size: 0x30, Max: 0x000000a0, ABSOLUTE)

    Execution Region EXECUTION_REGION_02 (Base:0x0,Size:0x30,Max:0xffffffff,ABSOLUTE, COMPRESSED[0x20])

I found that the size of load region after compression is 0x20, but the start address of second load region is 0x30 ! And, the decompression of first region work correctly, but arm try to decompress the second region from address "0x30" not "0x20".

Therefore, a wrong decompression result is produced. How to make the arm linker decompress the second correctly? Or how can I assign the load address of second load region LOAD_REGION_02 with attribute +0 (since the size load region 1 may changed...) ?

I read all the user manual but no answer...

0