3

I am looking at ARC processor map file and found a section which end address is less than start address.

Is this normal or a bug in the linker script or other issues?

Section name         type     start addr    end addr    length
RM0_SECTION          bss       00040000    0003ffff     00000000
electro
  • 911
  • 4
  • 12
  • 28
  • 4
    'length 00000000', I guess. If it was 00040000/00040000, that would mean length 00000001, ie. 'first valid address is 00040000, last valid address is 00040000'. – Martin James Dec 27 '17 at 21:07
  • Wonder if it might be more an oddity of the software outputting the sections. would be surprised if this is how it is represented in the actual generated file. – Michael Petch Dec 28 '17 at 03:19

1 Answers1

1

This is a normal behavior.
The formula to comply with is the following:

length = "end addr" - "start addr" + 1

So:
- if the section is not empty, end addr corresponds to the last address that belongs to the section.
- if the section is empty, end addr equals start addr - 1, which means that end addr is NOT an end address in this case, as you observed for RM0_SECTION.

Laurent H.
  • 6,316
  • 1
  • 18
  • 40