comparison lisp/progmodes/ld-script.el @ 72117:25da237ef5a9

(ld-script-keywords) (ld-script-font-lock-keywords, ld-script-builtins): Update keywords and add comments.
author Masatake YAMATO <jet@gyve.org>
date Tue, 25 Jul 2006 11:49:04 +0000
parents dc49655f57ae
children a7d759873ecf 858cb33ae39d
comparison
equal deleted inserted replaced
72116:1a37f6416b9f 72117:25da237ef5a9
72 (modify-syntax-entry ?\" "\"" st) 72 (modify-syntax-entry ?\" "\"" st)
73 st) 73 st)
74 "Syntax table used while in `ld-script-mode'.") 74 "Syntax table used while in `ld-script-mode'.")
75 75
76 ;; Font lock keywords 76 ;; Font lock keywords
77 ;; (The section number comes from ld's info.)
77 (defvar ld-script-keywords 78 (defvar ld-script-keywords
78 '("ENTRY" "INCLUDE" "INPUT" "GROUP" 79 '(
79 "OUTPUT" "SEARCH_DIR" "STARTUP" 80 ;; 3.4.1 Setting the Entry Point
81 "ENTRY"
82 ;; 3.4.2 Commands Dealing with Files
83 "INCLUDE" "INPUT" "GROUP" "AS_NEEDED" "OUTPUT" "SEARCH_DIR" "STARTUP"
84 ;; 3.4.3 Commands Dealing with Object File Formats
80 "OUTPUT_FORMAT" "TARGET" 85 "OUTPUT_FORMAT" "TARGET"
81 "ASSERT" "EXTERN" "FORCE_COMMON_ALLOCATION" "NOCROSSREFS" "OUTPUT_ARCH" 86 ;; 3.4.3 Other Linker Script Commands
87 "ASSERT" "EXTERN" "FORCE_COMMON_ALLOCATION"
88 "INHIBIT_COMMON_ALLOCATION" "NOCROSSREFS" "OUTPUT_ARCH"
89 ;; 3.5.2 PROVIDE
82 "PROVIDE" 90 "PROVIDE"
83 "SECTIONS" "SORT" "COMMON" "KEEP" 91 ;; 3.5.3 PROVIDE_HIDDEN
84 "BYTE" "SHORT" "LONG" "QUAD" "SQAD" 92 "PROVIDE_HIDEN"
85 "FILL" 93 ;; 3.6 SECTIONS Command
86 "CREATE_OBJECT_SYMBOLS" 94 "SECTIONS"
87 "CONSTRUCTORS" 95 ;; 3.6.4.2 Input Section Wildcard Patterns
96 "SORT" "SORT_BY_NAME" "SORT_BY_ALIGNMENT"
97 ;; 3.6.4.3 Input Section for Common Symbols
98 "COMMON"
99 ;; 3.6.4.4 Input Section and Garbage Collection
100 "KEEP"
101 ;; 3.6.5 Output Section Data
102 "BYTE" "SHORT" "LONG" "QUAD" "SQUAD" "FILL"
103 ;; 3.6.6 Output Section Keywords
104 "CREATE_OBJECT_SYMBOLS" "CONSTRUCTORS"
105 "__CTOR_LIST__" "__CTOR_END__" "__DTOR_LIST__" "__DTOR_END__"
106 ;; 3.6.7 Output Section Discarding
107 ;; See `ld-script-font-lock-keywords'
108 ;; 3.6.8.1 Output Section Type
88 "NOLOAD" "DSECT" "COPY" "INFO" "OVERLAY" 109 "NOLOAD" "DSECT" "COPY" "INFO" "OVERLAY"
110 ;; 3.6.8.2 Output Section LMA
89 "AT" 111 "AT"
112 ;; 3.6.8.4 Forced Input Alignment
113 "SUBALIGN"
114 ;; 3.6.8.6 Output Section Phdr
115 ":PHDR"
116 ;; 3.7 MEMORY Command
90 "MEMORY" 117 "MEMORY"
118 ;; 3.8 PHDRS Command
91 "PHDRS" "FILEHDR" "FLAGS" 119 "PHDRS" "FILEHDR" "FLAGS"
92 "PT_NULL" "PT_LOAD" "PT_DYNAMIC" "PT_INTERP" "PT_NONE" "PT_SHLIB" "PT_PHDR" 120 "PT_NULL" "PT_LOAD" "PT_DYNAMIC" "PT_INTERP" "PT_NONE" "PT_SHLIB" "PT_PHDR"
121 ;; 3.9 VERSION Command
93 "VERSION") 122 "VERSION")
94 "Keywords used of GNU ld script.") 123 "Keywords used of GNU ld script.")
95 124
125 ;; 3.10.8 Builtin Functions
96 (defvar ld-script-builtins 126 (defvar ld-script-builtins
97 '("ABSOLUTE" 127 '("ABSOLUTE"
98 "ADDR" 128 "ADDR"
99 "ALIGN" 129 "ALIGN"
100 "BLOCK" 130 "BLOCK"
101 "DATA_SEGMENT_ALIGN" 131 "DATA_SEGMENT_ALIGN"
102 "DATA_SEGMENT_END" 132 "DATA_SEGMENT_END"
103 "DATA_SEGMENT_RELRO_END" 133 "DATA_SEGMENT_RELRO_END"
104 "DEFINED" 134 "DEFINED"
105 "LENGTH" 135 "LENGTH" "len" "l"
106 "LOADADDR" 136 "LOADADDR"
107 "MAX" 137 "MAX"
108 "MIN" 138 "MIN"
109 "NEXT" 139 "NEXT"
110 "ORIGIN" 140 "ORIGIN" "org" "o"
111 "SEGMENT_START" 141 "SEGMENT_START"
112 "SIZEOF" 142 "SIZEOF"
113 "SIZEOF_HEADERS" 143 "SIZEOF_HEADERS"
114 "sizeof_headers") 144 "sizeof_headers")
115 "Builtin functions of GNU ld script.") 145 "Builtin functions of GNU ld script.")
118 (append 148 (append
119 `((,(regexp-opt ld-script-keywords 'words) 149 `((,(regexp-opt ld-script-keywords 'words)
120 1 font-lock-keyword-face) 150 1 font-lock-keyword-face)
121 (,(regexp-opt ld-script-builtins 'words) 151 (,(regexp-opt ld-script-builtins 'words)
122 1 font-lock-builtin-face) 152 1 font-lock-builtin-face)
123 ("/DISCARD/" . font-lock-warning-face) 153 ;; 3.6.7 Output Section Discarding
154 ;; 3.6.4.1 Input Section Basics
155 ;; 3.6.8.6 Output Section Phdr
156 ("/DISCARD/\\|EXCLUDE_FILE\\|:NONE" . font-lock-warning-face)
124 ("\\W\\(\\.\\)\\W" 1 ld-script-location-counter-face) 157 ("\\W\\(\\.\\)\\W" 1 ld-script-location-counter-face)
125 ) 158 )
126 cpp-font-lock-keywords) 159 cpp-font-lock-keywords)
127 "Default font-lock-keywords for `ld-script-mode'.") 160 "Default font-lock-keywords for `ld-script-mode'.")
128 161