372
|
1 " Vim syntax file
|
11062
|
2 " Language: ld(1) script
|
|
3 " Previous Maintainer: Nikolai Weibull <now@bitwi.se>
|
|
4 " Latest Revision: 2006-04-19
|
32294
|
5 " Last Change: 2023 Apr 19
|
372
|
6
|
|
7 if exists("b:current_syntax")
|
|
8 finish
|
|
9 endif
|
|
10
|
|
11 let s:cpo_save = &cpo
|
|
12 set cpo&vim
|
|
13
|
|
14 syn keyword ldTodo contained TODO FIXME XXX NOTE
|
|
15
|
|
16 syn region ldComment start='/\*' end='\*/' contains=ldTodo,@Spell
|
|
17
|
|
18 syn region ldFileName start=+"+ end=+"+
|
|
19
|
375
|
20 syn keyword ldPreProc SECTIONS MEMORY OVERLAY PHDRS VERSION INCLUDE
|
372
|
21 syn match ldPreProc '\<VERS_\d\+\.\d\+'
|
|
22
|
|
23 syn keyword ldFunction ABSOLUTE ADDR ALIGN BLOCK DATA_SEGMENT_ALIGN
|
|
24 \ DATA_SEGMENT_END DATA_SEGMENT_RELRO_END DEFINED
|
|
25 \ LOADADDR MAX MIN NEXT SIZEOF SIZEOF_HEADERS
|
|
26 \ sizeof_headers
|
|
27
|
375
|
28 syn keyword ldKeyword ENTRY INPUT GROUP OUTPUT
|
372
|
29 \ SEARCH_DIR STARTUP OUTPUT_FORMAT TARGET
|
|
30 \ ASSERT EXTERN FORCE_COMMON_ALLOCATION
|
|
31 \ INHIBIT_COMMON_ALLOCATION NOCROSSREFS OUTPUT_ARCH
|
|
32 \ PROVIDE EXCLUDE_FILE SORT KEEP FILL
|
|
33 \ CREATE_OBJECT_SYMBOLS CONSTRUCTORS SUBALIGN
|
|
34 \ FILEHDR AT __asm__ ABSOLUTE
|
|
35
|
|
36 syn keyword ldDataType BYTE SHORT LONG QUAD SQUAD
|
|
37 syn keyword ldOutputType NOLOAD DSECT COPY INFO OVERLAY
|
|
38 syn keyword ldPTType PT_NULL PT_LOAD PT_DYNAMIC PT_INTERP
|
|
39 \ PT_NOTE PT_SHLIB PT_PHDR
|
|
40
|
|
41 syn keyword ldSpecial COMMON
|
|
42 syn match ldSpecial '/DISCARD/'
|
|
43
|
|
44 syn keyword ldIdentifier ORIGIN LENGTH
|
|
45
|
|
46 syn match ldSpecSections '\.'
|
32294
|
47 syn match ldSections '\.[^ \t)]\+'
|
372
|
48 syn match ldSpecSections '\.\%(text\|data\|bss\|symver\)\>'
|
|
49
|
|
50 syn match ldNumber display '\<0[xX]\x\+\>'
|
|
51 syn match ldNumber display '\d\+[KM]\>' contains=ldNumberMult
|
18186
|
52 syn match ldNumberMult display '\(\d\+\)\@<=[KM]\>'
|
372
|
53 syn match ldOctal contained display '\<0\o\+\>'
|
|
54 \ contains=ldOctalZero
|
|
55 syn match ldOctalZero contained display '\<0'
|
|
56 syn match ldOctalError contained display '\<0\o*[89]\d*\>'
|
|
57
|
|
58
|
|
59 hi def link ldTodo Todo
|
|
60 hi def link ldComment Comment
|
|
61 hi def link ldFileName String
|
|
62 hi def link ldPreProc PreProc
|
|
63 hi def link ldFunction Identifier
|
|
64 hi def link ldKeyword Keyword
|
|
65 hi def link ldType Type
|
|
66 hi def link ldDataType ldType
|
|
67 hi def link ldOutputType ldType
|
|
68 hi def link ldPTType ldType
|
|
69 hi def link ldSpecial Special
|
|
70 hi def link ldIdentifier Identifier
|
|
71 hi def link ldSections Constant
|
|
72 hi def link ldSpecSections Special
|
|
73 hi def link ldNumber Number
|
|
74 hi def link ldNumberMult PreProc
|
|
75 hi def link ldOctal ldNumber
|
|
76 hi def link ldOctalZero PreProc
|
|
77 hi def link ldOctalError Error
|
|
78
|
|
79 let b:current_syntax = "ld"
|
|
80
|
|
81 let &cpo = s:cpo_save
|
|
82 unlet s:cpo_save
|