llvm-pic / llvm-pic

LLVM backend implementation for the PIC architecture. Refer to this repo's wiki for more information ⤵
https://github.com/llvm-pic/llvm-pic/wiki
Other
13 stars 1 forks source link

Write Linker Scripts and Startup Files #39

Open pr1metine opened 7 months ago

pr1metine commented 7 months ago

Is your feature request related to a problem? Please describe. While two types of microcontroller may share the same instruction set, these two types may have a different program memory layout. For example, one microcontroller type may execute the instruction associated to program memory address 0x00 upon reset. Another may execute instruction 0x04 first. Furthermore, some aspects may need to be initialized prior to executing the main function. E.g., C requires that all uninitialized global variables must be initialized with zero.

Describe the solution you'd like Linker scripts tell the compiler where to put certain sections of code, i.e., to which program memory location. Startup files serve as an initial entry point of a program. We shall implement linker scripts and startup files required to write C code targeting PIC16F883.

Describe alternatives you've considered Perhaps, we may take existing linker scripts and startup files from other projects. They must be open-source.

Additional context

handiener commented 3 months ago

setting the configuration bits is fixed now https://github.com/llvm-pic/experiments/commit/0b1147afbe14b71d2bdde19662b135d0ff9895ba also a prototype for startup and linker script exist