You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In GeckOS V2, in some cases an undefined reference is not added, but subtracted from another value.
One specific case is where ROMSTART defines the beginning of the "rom" image that is scanned for executable file images. Within the rom image, each entry defines how much "rom" is mapped from the top of memory into the specific tasks memory map (note this is relevant to MMU-based ports). The resulting code where this value is defined looks like:
.byt > $ff - ROMSTART
ROMSTART is an address that may be redefined during the build process through relocation of the rom image.
This cannot be relocated at this time, as o65 does not define a negative undefined value.
To overcome this, the following is proposed:
Currently the segment ID is defined as:
0 undefined
1 absolute value
2 text segment
3 data segment
4 bss segment
5 zero segment
where "absolute value" does not appear in the relocation table. This segment ID, however, is used in the list of exported globals, but there no undefined segment appears.
The proposal is:
use segment ID value "1" as "negative undefined" entry in the relocation table
use segment ID value "1" as "absolute value" in the list of exported globals.
This achieves the following:
existing loaders should note an "illegal" segment value and should refuse to load such a file, doing a "fail fast" approach (avoid extensive troubleshooting)
no extra bit used
An alternative would have been to use e.g. bit $10 in the segment ID, but this is only relevant in exactly one segment, and wasted otherwise. Also existing loaders may ignore this bit. So, it is the redefinition of the absolute segment for the relocation table.
The text was updated successfully, but these errors were encountered:
In GeckOS V2, in some cases an undefined reference is not added, but subtracted from another value.
One specific case is where ROMSTART defines the beginning of the "rom" image that is scanned for executable file images. Within the rom image, each entry defines how much "rom" is mapped from the top of memory into the specific tasks memory map (note this is relevant to MMU-based ports). The resulting code where this value is defined looks like:
ROMSTART is an address that may be redefined during the build process through relocation of the rom image.
This cannot be relocated at this time, as o65 does not define a negative undefined value.
To overcome this, the following is proposed:
Currently the segment ID is defined as:
where "absolute value" does not appear in the relocation table. This segment ID, however, is used in the list of exported globals, but there no undefined segment appears.
The proposal is:
This achieves the following:
An alternative would have been to use e.g. bit $10 in the segment ID, but this is only relevant in exactly one segment, and wasted otherwise. Also existing loaders may ignore this bit. So, it is the redefinition of the absolute segment for the relocation table.
The text was updated successfully, but these errors were encountered: