blob: 45ca382aca0db96d7e9ae5c80c9dfed4934e7261 [file] [log] [blame]
Wu, Zhenyu39a4eb02024-12-31 10:25:44 +01001" Vim syntax file
2" Language: TI linker command file
3" Document: https://downloads.ti.com/docs/esd/SPRUI03A/Content/SPRUI03A_HTML/linker_description.html
4" Document: https://software-dl.ti.com/ccs/esd/documents/sdto_cgt_Linker-Command-File-Primer.html
5" Maintainer: Wu, Zhenyu <wuzhenyu@ustc.edu>
6" Last Change: 2024 Dec 31
7
8if exists("b:current_syntax")
9 finish
10endif
11
12runtime! syntax/cmacro.vim
13
14syn case ignore
15syn match lnkNumber "0x[0-9a-f]\+"
16" Linker command files are ASCII files that contain one or more of the following:
17" Input filenames, which specify object files, archive libraries, or other command files.
18" Linker options, which can be used in the command file in the same manner that they are used on the command line
19syn match lnkOption "^[-+][-_a-zA-Z#@]\+"
20syn match lnkOption "^--[^ \t$=`'"|);]\+"
21syn match lnkFile '[^ =]\+\%(\.\S\+\)\+\>'
22syn match lnkLibFile '[^ =]\+\.lib\>'
23" The MEMORY and SECTIONS linker directives. The MEMORY directive defines the target memory configuration (see Section 8.5.4). The SECTIONS directive controls how sections are built and allocated (see Section 8.5.5.)
24syn keyword lnkKeyword ADDRESS_MASK f LOAD ORIGIN START ALGORITHM FILL LOAD_END PAGE TABLE ALIGN GROUP LOAD_SIZE PALIGN TYPE ATTR HAMMING_MASK LOAD_START PARITY_MASK UNION BLOCK HIGH MEMORY RUN UNORDERED COMPRESSION INPUT_PAGE MIRRORING RUN_END VFILL COPY INPUT_RANGE NOINIT RUN_SIZE DSECT l NOLOAD RUN_START ECC LEN o SECTIONS END LENGTH ORG SIZE
25syn region lnkLibrary start=+<+ end=+>+
26syn match lnkAttrib '\<[RWXI]\+\>'
27syn match lnkSections '\<\.\k\+'
28" Assignment statements, which define and assign values to global symbols
29syn case match
30
31hi def link lnkNumber Number
32hi def link lnkOption Special
33hi def link lnkKeyword Keyword
34hi def link lnkLibrary String
35hi def link lnkFile String
36hi def link lnkLibFile Special
37hi def link lnkAttrib Type
38hi def link lnkSections Macro
39
40let b:current_syntax = "lnk"