[PATCH v1 0/3 CHIP: Support vendor script libraries
binutils@emagii.com
binutils@emagii.com
Tue Mar 14 22:01:11 GMT 2023
Patchset 1
Introduce the CHIP command for non-MRI script files.
The motivation is that you want to simplify supporting microcontrollers.
You want include files that define the addresses for all peripherals
and the memory/bank organisation.
CHIP "<chip>" will add directories to the include directory list
and will then include the "<chip>.inc" file.
chip "<chip>" will add
* "$PROJ_DIR"
* "$LD_USER_DIR/<chip>"
* "$LD_VENDOR_DIR/<chip>"
to the search list for script files.
The search order will be:
"<Current directory>"
"$PROJ_DIR"
"$LD_USER_DIR/<chip>"
"$LD_VENDOR_DIR/<chip>"
This allows the vendor to supply a directory tree (LD_VENDOR_DIR).
with a subdirectory for each chip.
The subdirectory contains the "<chip>.inc" file which
can have the flash sectors using the BANK command
(patch posted to the link) as well as symbols
for all the peripherals for the chip.
Obviously, the vendor can place other files there as well.
chip "at91sam7s64"
would result in the linker including the file
$LD_VENDOR_DIR/at91sam7s64/at91sam7s64.inc
Since the vendor might be late with supplying include files
for a chip, the user can create a similar directory in LD_USER_DIR.
chip "at91sam7s64"
This would result in the linker including the file
$LD_USER_DIR/atmel/at91sam7s64/at91sam7s64.inc
since LD_USER_DIR is before LD_VENDOR_DIR in the search order.
If the user wants to simply put the file in their project
they can rely on the search order, or put the file in $PROJ_DIR
chip "at91sam7s64";
This would result in the linker including the file
$PROJ_DIR/at91sam7s64.inc
=================================
I am considering a further extension:
chip "at91sam7s64", "atmel";
This would result in the linker including the file
$LD_VENDOR_DIR/atmel/at91sam7s64/at91sam7s64.inc
[PATCH v1 1/3] CHIP: ldlex.l
[PATCH v1 2/3] CHIP: ldgram.y
[PATCH v1 3/3] CHIP: language additions
More information about the Binutils
mailing list