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