With the Keil Compiler linker, it is possible to specify the
absolute memory address of a code segment for a specific
function call. This is useful when setting aside a region of
code memory for a seperate piece of code such as a
bootloader, whose address you wish to specify explicitly.
For example, the Keil linker directive
CODE(?PR?*?OSOverwrite(0x7800))
will place the OSOverwrite() function at adress 0x7800 in
code space.
Would it be feasible to implement a similar option in the
sdcc linker?
Logged In: YES
user_id=888171
This is now possible in SDCC 2.5.1 #1061.
You use the command line option --codeseg MYSEG when
compiling or pragma codeseg MYSEG inside the source to
specify the name of the code segment. Then when linking
you use -Wl-b MYSEG=0x7800 to set the start address of
this segment.
Maarten