public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
* [PATCH v1 0/3 CHIP: Support vendor script libraries
@ 2023-03-14 22:01 binutils
  2023-03-14 22:01 ` [PATCH v1 1/3] CHIP: ldlex.l binutils
                   ` (4 more replies)
  0 siblings, 5 replies; 11+ messages in thread
From: binutils @ 2023-03-14 22:01 UTC (permalink / raw)
  To: binutils; +Cc: nickc

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


^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2023-03-16 15:57 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-03-14 22:01 [PATCH v1 0/3 CHIP: Support vendor script libraries binutils
2023-03-14 22:01 ` [PATCH v1 1/3] CHIP: ldlex.l binutils
2023-03-14 22:01 ` [PATCH v1 2/3] CHIP: ldgram.y binutils
2023-03-14 22:01 ` [PATCH v1 3/3] CHIP: language additions binutils
2023-03-14 22:06 ` [PATCH v1 0/3 CHIP: Support vendor script libraries Ulf Samuelsson
2023-03-15 16:27 ` Michael Matz
2023-03-15 20:03   ` Ulf Samuelsson
2023-03-16  8:23     ` Jan Beulich
2023-03-16 10:25       ` Ulf Samuelsson
2023-03-16 15:05     ` Michael Matz
2023-03-16 15:57       ` Ulf Samuelsson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).