1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
35:
36:
37:
38:
39:
40:
41:
42:
43:
44:
45:
46:
47: #define YYBISON 1
48:
49:
50: #define YYBISON_VERSION "2.3"
51:
52:
53: #define YYSKELETON_NAME "yacc.c"
54:
55:
56: #define YYPURE 0
57:
58:
59: #define YYLSP_NEEDED 0
60:
61:
62:
63:
64: #ifndef YYTOKENTYPE
65: # define YYTOKENTYPE
66:
67:
68: enum yytokentype {
69: INT = 258,
70: NAME = 259,
71: LNAME = 260,
72: OREQ = 261,
73: ANDEQ = 262,
74: RSHIFTEQ = 263,
75: LSHIFTEQ = 264,
76: DIVEQ = 265,
77: MULTEQ = 266,
78: MINUSEQ = 267,
79: PLUSEQ = 268,
80: OROR = 269,
81: ANDAND = 270,
82: NE = 271,
83: EQ = 272,
84: GE = 273,
85: LE = 274,
86: RSHIFT = 275,
87: LSHIFT = 276,
88: UNARY = 277,
89: END = 278,
90: ALIGN_K = 279,
91: BLOCK = 280,
92: BIND = 281,
93: QUAD = 282,
94: SQUAD = 283,
95: LONG = 284,
96: SHORT = 285,
97: BYTE = 286,
98: SECTIONS = 287,
99: PHDRS = 288,
100: DATA_SEGMENT_ALIGN = 289,
101: DATA_SEGMENT_RELRO_END = 290,
102: DATA_SEGMENT_END = 291,
103: SORT_BY_NAME = 292,
104: SORT_BY_ALIGNMENT = 293,
105: SIZEOF_HEADERS = 294,
106: OUTPUT_FORMAT = 295,
107: FORCE_COMMON_ALLOCATION = 296,
108: OUTPUT_ARCH = 297,
109: INHIBIT_COMMON_ALLOCATION = 298,
110: SEGMENT_START = 299,
111: INCLUDE = 300,
112: MEMORY = 301,
113: NOLOAD = 302,
114: DSECT = 303,
115: COPY = 304,
116: INFO = 305,
117: OVERLAY = 306,
118: DEFINED = 307,
119: TARGET_K = 308,
120: SEARCH_DIR = 309,
121: MAP = 310,
122: ENTRY = 311,
123: NEXT = 312,
124: SIZEOF = 313,
125: ALIGNOF = 314,
126: ADDR = 315,
127: LOADADDR = 316,
128: MAX_K = 317,
129: MIN_K = 318,
130: STARTUP = 319,
131: HLL = 320,
132: SYSLIB = 321,
133: FLOAT = 322,
134: NOFLOAT = 323,
135: NOCROSSREFS = 324,
136: ORIGIN = 325,
137: FILL = 326,
138: LENGTH = 327,
139: CREATE_OBJECT_SYMBOLS = 328,
140: INPUT = 329,
141: GROUP = 330,
142: OUTPUT = 331,
143: CONSTRUCTORS = 332,
144: ALIGNMOD = 333,
145: AT = 334,
146: SUBALIGN = 335,
147: PROVIDE = 336,
148: PROVIDE_HIDDEN = 337,
149: AS_NEEDED = 338,
150: CHIP = 339,
151: LIST = 340,
152: SECT = 341,
153: ABSOLUTE = 342,
154: LOAD = 343,
155: NEWLINE = 344,
156: ENDWORD = 345,
157: ORDER = 346,
158: NAMEWORD = 347,
159: ASSERT_K = 348,
160: FORMAT = 349,
161: PUBLIC = 350,
162: DEFSYMEND = 351,
163: BASE = 352,
164: ALIAS = 353,
165: TRUNCATE = 354,
166: REL = 355,
167: INPUT_SCRIPT = 356,
168: INPUT_MRI_SCRIPT = 357,
169: INPUT_DEFSYM = 358,
170: CASE = 359,
171: EXTERN = 360,
172: START = 361,
173: VERS_TAG = 362,
174: VERS_IDENTIFIER = 363,
175: GLOBAL = 364,
176: LOCAL = 365,
177: VERSIONK = 366,
178: INPUT_VERSION_SCRIPT = 367,
179: KEEP = 368,
180: ONLY_IF_RO = 369,
181: ONLY_IF_RW = 370,
182: SPECIAL = 371,
183: EXCLUDE_FILE = 372,
184: CONSTANT = 373,
185: INPUT_DYNAMIC_LIST = 374
186: };
187: #endif
188:
189: #define INT 258
190: #define NAME 259
191: #define LNAME 260
192: #define OREQ 261
193: #define ANDEQ 262
194: #define RSHIFTEQ 263
195: #define LSHIFTEQ 264
196: #define DIVEQ 265
197: #define MULTEQ 266
198: #define MINUSEQ 267
199: #define PLUSEQ 268
200: #define OROR 269
201: #define ANDAND 270
202: #define NE 271
203: #define EQ 272
204: #define GE 273
205: #define LE 274
206: #define RSHIFT 275
207: #define LSHIFT 276
208: #define UNARY 277
209: #define END 278
210: #define ALIGN_K 279
211: #define BLOCK 280
212: #define BIND 281
213: #define QUAD 282
214: #define SQUAD 283
215: #define LONG 284
216: #define SHORT 285
217: #define BYTE 286
218: #define SECTIONS 287
219: #define PHDRS 288
220: #define DATA_SEGMENT_ALIGN 289
221: #define DATA_SEGMENT_RELRO_END 290
222: #define DATA_SEGMENT_END 291
223: #define SORT_BY_NAME 292
224: #define SORT_BY_ALIGNMENT 293
225: #define SIZEOF_HEADERS 294
226: #define OUTPUT_FORMAT 295
227: #define FORCE_COMMON_ALLOCATION 296
228: #define OUTPUT_ARCH 297
229: #define INHIBIT_COMMON_ALLOCATION 298
230: #define SEGMENT_START 299
231: #define INCLUDE 300
232: #define MEMORY 301
233: #define NOLOAD 302
234: #define DSECT 303
235: #define COPY 304
236: #define INFO 305
237: #define OVERLAY 306
238: #define DEFINED 307
239: #define TARGET_K 308
240: #define SEARCH_DIR 309
241: #define MAP 310
242: #define ENTRY 311
243: #define NEXT 312
244: #define SIZEOF 313
245: #define ALIGNOF 314
246: #define ADDR 315
247: #define LOADADDR 316
248: #define MAX_K 317
249: #define MIN_K 318
250: #define STARTUP 319
251: #define HLL 320
252: #define SYSLIB 321
253: #define FLOAT 322
254: #define NOFLOAT 323
255: #define NOCROSSREFS 324
256: #define ORIGIN 325
257: #define FILL 326
258: #define LENGTH 327
259: #define CREATE_OBJECT_SYMBOLS 328
260: #define INPUT 329
261: #define GROUP 330
262: #define OUTPUT 331
263: #define CONSTRUCTORS 332
264: #define ALIGNMOD 333
265: #define AT 334
266: #define SUBALIGN 335
267: #define PROVIDE 336
268: #define PROVIDE_HIDDEN 337
269: #define AS_NEEDED 338
270: #define CHIP 339
271: #define LIST 340
272: #define SECT 341
273: #define ABSOLUTE 342
274: #define LOAD 343
275: #define NEWLINE 344
276: #define ENDWORD 345
277: #define ORDER 346
278: #define NAMEWORD 347
279: #define ASSERT_K 348
280: #define FORMAT 349
281: #define PUBLIC 350
282: #define DEFSYMEND 351
283: #define BASE 352
284: #define ALIAS 353
285: #define TRUNCATE 354
286: #define REL 355
287: #define INPUT_SCRIPT 356
288: #define INPUT_MRI_SCRIPT 357
289: #define INPUT_DEFSYM 358
290: #define CASE 359
291: #define EXTERN 360
292: #define START 361
293: #define VERS_TAG 362
294: #define VERS_IDENTIFIER 363
295: #define GLOBAL 364
296: #define LOCAL 365
297: #define VERSIONK 366
298: #define INPUT_VERSION_SCRIPT 367
299: #define KEEP 368
300: #define ONLY_IF_RO 369
301: #define ONLY_IF_RW 370
302: #define SPECIAL 371
303: #define EXCLUDE_FILE 372
304: #define CONSTANT 373
305: #define INPUT_DYNAMIC_LIST 374
306:
307:
308:
309:
310:
311: #line 23 "ldgram.y"
312:
313:
314:
315:
316:
317: #define DONTDECLARE_MALLOC
318:
319: #include "sysdep.h"
320: #include "bfd.h"
321: #include "bfdlink.h"
322: #include "ld.h"
323: #include "ldexp.h"
324: #include "ldver.h"
325: #include "ldlang.h"
326: #include "ldfile.h"
327: #include "ldemul.h"
328: #include "ldmisc.h"
329: #include "ldmain.h"
330: #include "mri.h"
331: #include "ldctor.h"
332: #include "ldlex.h"
333:
334: #ifndef YYDEBUG
335: #define YYDEBUG 1
336: #endif
337:
338: static enum section_type sectype;
339: static lang_memory_region_type *region;
340:
341: FILE *saved_script_handle = NULL;
342: bfd_boolean force_make_executable = FALSE;
343:
344: bfd_boolean ldgram_in_script = FALSE;
345: bfd_boolean ldgram_had_equals = FALSE;
346: bfd_boolean ldgram_had_keep = FALSE;
347: char *ldgram_vers_current_lang = NULL;
348:
349: #define ERROR_NAME_MAX 20
350: static char *error_names[ERROR_NAME_MAX];
351: static int error_index;
352: #define PUSH_ERROR(x) if (error_index < ERROR_NAME_MAX) error_names[error_index] = x; error_index++;
353: #define POP_ERROR() error_index--;
354:
355:
356:
357: #ifndef YYDEBUG
358: # define YYDEBUG 0
359: #endif
360:
361:
362: #ifdef YYERROR_VERBOSE
363: # undef YYERROR_VERBOSE
364: # define YYERROR_VERBOSE 1
365: #else
366: # define YYERROR_VERBOSE 0
367: #endif
368:
369:
370: #ifndef YYTOKEN_TABLE
371: # define YYTOKEN_TABLE 0
372: #endif
373:
374: #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
375: typedef union YYSTYPE
376: #line 66 "ldgram.y"
377: {
378: bfd_vma integer;
379: struct big_int
380: {
381: bfd_vma integer;
382: char *str;
383: } bigint;
384: fill_type *fill;
385: char *name;
386: const char *cname;
387: struct wildcard_spec wildcard;
388: struct wildcard_list *wildcard_list;
389: struct name_list *name_list;
390: int token;
391: union etree_union *etree;
392: struct phdr_info
393: {
394: bfd_boolean filehdr;
395: bfd_boolean phdrs;
396: union etree_union *at;
397: union etree_union *flags;
398: } phdr;
399: struct lang_nocrossref *nocrossref;
400: struct lang_output_section_phdr_list *section_phdr;
401: struct bfd_elf_version_deps *deflist;
402: struct bfd_elf_version_expr *versyms;
403: struct bfd_elf_version_tree *versnode;
404: }
405:
406: #line 407 "ldgram.c"
407: YYSTYPE;
408: # define yystype YYSTYPE
409: # define YYSTYPE_IS_DECLARED 1
410: # define YYSTYPE_IS_TRIVIAL 1
411: #endif
412:
413:
414:
415:
416:
417:
418:
419: #line 420 "ldgram.c"
420:
421: #ifdef short
422: # undef short
423: #endif
424:
425: #ifdef YYTYPE_UINT8
426: typedef YYTYPE_UINT8 yytype_uint8;
427: #else
428: typedef unsigned char yytype_uint8;
429: #endif
430:
431: #ifdef YYTYPE_INT8
432: typedef YYTYPE_INT8 yytype_int8;
433: #elif (defined __STDC__ || defined __C99__FUNC__ \
434: || defined __cplusplus || defined _MSC_VER)
435: typedef signed char yytype_int8;
436: #else
437: typedef short int yytype_int8;
438: #endif
439:
440: #ifdef YYTYPE_UINT16
441: typedef YYTYPE_UINT16 yytype_uint16;
442: #else
443: typedef unsigned short int yytype_uint16;
444: #endif
445:
446: #ifdef YYTYPE_INT16
447: typedef YYTYPE_INT16 yytype_int16;
448: #else
449: typedef short int yytype_int16;
450: #endif
451:
452: #ifndef YYSIZE_T
453: # ifdef __SIZE_TYPE__
454: # define YYSIZE_T __SIZE_TYPE__
455: # elif defined size_t
456: # define YYSIZE_T size_t
457: # elif ! defined YYSIZE_T && (defined __STDC__ || defined __C99__FUNC__ \
458: || defined __cplusplus || defined _MSC_VER)
459: # include <stddef.h>
460: # define YYSIZE_T size_t
461: # else
462: # define YYSIZE_T unsigned int
463: # endif
464: #endif
465:
466: #define YYSIZE_MAXIMUM ((YYSIZE_T) -1)
467:
468: #ifndef YY_
469: # if YYENABLE_NLS
470: # if ENABLE_NLS
471: # include <libintl.h>
472: # define YY_(msgid) dgettext ("bison-runtime", msgid)
473: # endif
474: # endif
475: # ifndef YY_
476: # define YY_(msgid) msgid
477: # endif
478: #endif
479:
480:
481: #if ! defined lint || defined __GNUC__
482: # define YYUSE(e) ((void) (e))
483: #else
484: # define YYUSE(e)
485: #endif
486:
487:
488: #ifndef lint
489: # define YYID(n) (n)
490: #else
491: #if (defined __STDC__ || defined __C99__FUNC__ \
492: || defined __cplusplus || defined _MSC_VER)
493: static int
494: YYID (int i)
495: #else
496: static int
497: YYID (i)
498: int i;
499: #endif
500: {
501: return i;
502: }
503: #endif
504:
505: #if ! defined yyoverflow || YYERROR_VERBOSE
506:
507:
508:
509: # ifdef YYSTACK_USE_ALLOCA
510: # if YYSTACK_USE_ALLOCA
511: # ifdef __GNUC__
512: # define YYSTACK_ALLOC __builtin_alloca
513: # elif defined __BUILTIN_VA_ARG_INCR
514: # include <alloca.h>
515: # elif defined _AIX
516: # define YYSTACK_ALLOC __alloca
517: # elif defined _MSC_VER
518: # include <malloc.h>
519: # define alloca _alloca
520: # else
521: # define YYSTACK_ALLOC alloca
522: # if ! defined _ALLOCA_H && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
523: || defined __cplusplus || defined _MSC_VER)
524: # include <stdlib.h>
525: # ifndef _STDLIB_H
526: # define _STDLIB_H 1
527: # endif
528: # endif
529: # endif
530: # endif
531: # endif
532:
533: # ifdef YYSTACK_ALLOC
534:
535: # define YYSTACK_FREE(Ptr) do { ; } while (