* fnmatch.h, fnmatch.c: New files.
[deliverable/binutils-gdb.git] / ld / ldgram.y
1 /* A YACC grammer to parse a superset of the AT&T linker scripting languaue.
2 Copyright (C) 1991, 92, 93, 94, 95, 1996 Free Software Foundation, Inc.
3 Written by Steve Chamberlain of Cygnus Support (steve@cygnus.com).
4
5 This file is part of GNU ld.
6
7 This program is free software; you can redistribute it and/or modify
8 it under the terms of the GNU General Public License as published by
9 the Free Software Foundation; either version 2 of the License, or
10 (at your option) any later version.
11
12 This program is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 GNU General Public License for more details.
16
17 You should have received a copy of the GNU General Public License
18 along with this program; if not, write to the Free Software
19 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
20
21 %{
22 /*
23
24 */
25
26 #define DONTDECLARE_MALLOC
27
28 #include "bfd.h"
29 #include "sysdep.h"
30 #include "bfdlink.h"
31 #include "ld.h"
32 #include "ldexp.h"
33 #include "ldver.h"
34 #include "ldlang.h"
35 #include "ldemul.h"
36 #include "ldfile.h"
37 #include "ldmisc.h"
38 #include "ldmain.h"
39 #include "mri.h"
40 #include "ldlex.h"
41
42 #ifndef YYDEBUG
43 #define YYDEBUG 1
44 #endif
45
46 static enum section_type sectype;
47
48 lang_memory_region_type *region;
49
50
51 char *current_file;
52 boolean ldgram_want_filename = true;
53 boolean had_script = false;
54 boolean force_make_executable = false;
55
56 boolean ldgram_in_script = false;
57 boolean ldgram_had_equals = false;
58
59
60 #define ERROR_NAME_MAX 20
61 static char *error_names[ERROR_NAME_MAX];
62 static int error_index;
63 #define PUSH_ERROR(x) if (error_index < ERROR_NAME_MAX) error_names[error_index] = x; error_index++;
64 #define POP_ERROR() error_index--;
65 %}
66 %union {
67 bfd_vma integer;
68 char *name;
69 int token;
70 union etree_union *etree;
71 struct phdr_info
72 {
73 boolean filehdr;
74 boolean phdrs;
75 union etree_union *at;
76 union etree_union *flags;
77 } phdr;
78 }
79
80 %type <etree> exp opt_exp_with_type mustbe_exp opt_at phdr_type phdr_val
81 %type <integer> fill_opt
82 %type <name> memspec_opt casesymlist
83 %token <integer> INT
84 %token <name> NAME LNAME
85 %type <integer> length
86 %type <phdr> phdr_qualifiers
87
88 %right <token> PLUSEQ MINUSEQ MULTEQ DIVEQ '=' LSHIFTEQ RSHIFTEQ ANDEQ OREQ
89 %right <token> '?' ':'
90 %left <token> OROR
91 %left <token> ANDAND
92 %left <token> '|'
93 %left <token> '^'
94 %left <token> '&'
95 %left <token> EQ NE
96 %left <token> '<' '>' LE GE
97 %left <token> LSHIFT RSHIFT
98
99 %left <token> '+' '-'
100 %left <token> '*' '/' '%'
101
102 %right UNARY
103 %token END
104 %left <token> '('
105 %token <token> ALIGN_K BLOCK BIND QUAD LONG SHORT BYTE
106 %token SECTIONS PHDRS
107 %token '{' '}'
108 %token SIZEOF_HEADERS OUTPUT_FORMAT FORCE_COMMON_ALLOCATION OUTPUT_ARCH
109 %token SIZEOF_HEADERS
110 %token INCLUDE
111 %token MEMORY DEFSYMEND
112 %token NOLOAD DSECT COPY INFO OVERLAY
113 %token NAME LNAME DEFINED TARGET_K SEARCH_DIR MAP ENTRY
114 %token <integer> SIZEOF NEXT ADDR
115 %token STARTUP HLL SYSLIB FLOAT NOFLOAT
116 %token ORIGIN FILL
117 %token LENGTH CREATE_OBJECT_SYMBOLS INPUT GROUP OUTPUT CONSTRUCTORS
118 %token ALIGNMOD AT PROVIDE
119 %type <token> assign_op atype
120 %type <name> filename
121 %token CHIP LIST SECT ABSOLUTE LOAD NEWLINE ENDWORD ORDER NAMEWORD
122 %token FORMAT PUBLIC DEFSYMEND BASE ALIAS TRUNCATE REL
123 %token INPUT_SCRIPT INPUT_MRI_SCRIPT INPUT_DEFSYM CASE EXTERN START
124
125 %%
126
127 file:
128 INPUT_SCRIPT script_file
129 | INPUT_MRI_SCRIPT mri_script_file
130 | INPUT_DEFSYM defsym_expr
131 ;
132
133
134 filename: NAME;
135
136
137 defsym_expr:
138 { ldlex_defsym(); }
139 NAME '=' exp
140 {
141 ldlex_popstate();
142 lang_add_assignment(exp_assop($3,$2,$4));
143 }
144
145 /* SYNTAX WITHIN AN MRI SCRIPT FILE */
146 mri_script_file:
147 {
148 ldlex_mri_script ();
149 PUSH_ERROR ("MRI style script");
150 }
151 mri_script_lines
152 {
153 ldlex_popstate ();
154 mri_draw_tree ();
155 POP_ERROR ();
156 }
157 ;
158
159 mri_script_lines:
160 mri_script_lines mri_script_command NEWLINE
161 |
162 ;
163
164 mri_script_command:
165 CHIP exp
166 | CHIP exp ',' exp
167 | NAME {
168 einfo("%P%F: unrecognised keyword in MRI style script '%s'\n",$1);
169 }
170 | LIST {
171 config.map_filename = "-";
172 }
173 | ORDER ordernamelist
174 | ENDWORD
175 | PUBLIC NAME '=' exp
176 { mri_public($2, $4); }
177 | PUBLIC NAME ',' exp
178 { mri_public($2, $4); }
179 | PUBLIC NAME exp
180 { mri_public($2, $3); }
181 | FORMAT NAME
182 { mri_format($2); }
183 | SECT NAME ',' exp
184 { mri_output_section($2, $4);}
185 | SECT NAME exp
186 { mri_output_section($2, $3);}
187 | SECT NAME '=' exp
188 { mri_output_section($2, $4);}
189 | ALIGN_K NAME '=' exp
190 { mri_align($2,$4); }
191 | ALIGN_K NAME ',' exp
192 { mri_align($2,$4); }
193 | ALIGNMOD NAME '=' exp
194 { mri_alignmod($2,$4); }
195 | ALIGNMOD NAME ',' exp
196 { mri_alignmod($2,$4); }
197 | ABSOLUTE mri_abs_name_list
198 | LOAD mri_load_name_list
199 | NAMEWORD NAME
200 { mri_name($2); }
201 | ALIAS NAME ',' NAME
202 { mri_alias($2,$4,0);}
203 | ALIAS NAME ',' INT
204 { mri_alias($2,0,(int) $4);}
205 | BASE exp
206 { mri_base($2); }
207 | TRUNCATE INT
208 { mri_truncate((unsigned int) $2); }
209 | CASE casesymlist
210 | EXTERN extern_name_list
211 | INCLUDE filename
212 { ldfile_open_command_file ($2); } mri_script_lines END
213 | START NAME
214 { lang_add_entry ($2, false); }
215 |
216 ;
217
218 ordernamelist:
219 ordernamelist ',' NAME { mri_order($3); }
220 | ordernamelist NAME { mri_order($2); }
221 |
222 ;
223
224 mri_load_name_list:
225 NAME
226 { mri_load($1); }
227 | mri_load_name_list ',' NAME { mri_load($3); }
228 ;
229
230 mri_abs_name_list:
231 NAME
232 { mri_only_load($1); }
233 | mri_abs_name_list ',' NAME
234 { mri_only_load($3); }
235 ;
236
237 casesymlist:
238 /* empty */ { $$ = NULL; }
239 | NAME
240 | casesymlist ',' NAME
241 ;
242
243 extern_name_list:
244 NAME
245 { ldlang_add_undef ($1); }
246 | extern_name_list ',' NAME
247 { ldlang_add_undef ($3); }
248 ;
249
250 script_file:
251 {
252 ldlex_both();
253 }
254 ifile_list
255 {
256 ldlex_popstate();
257 }
258 ;
259
260
261 ifile_list:
262 ifile_list ifile_p1
263 |
264 ;
265
266
267
268 ifile_p1:
269 memory
270 | sections
271 | phdrs
272 | startup
273 | high_level_library
274 | low_level_library
275 | floating_point_support
276 | statement_anywhere
277 | ';'
278 | TARGET_K '(' NAME ')'
279 { lang_add_target($3); }
280 | SEARCH_DIR '(' filename ')'
281 { ldfile_add_library_path ($3, false); }
282 | OUTPUT '(' filename ')'
283 { lang_add_output($3, 1); }
284 | OUTPUT_FORMAT '(' NAME ')'
285 { lang_add_output_format ($3, (char *) NULL,
286 (char *) NULL, 1); }
287 | OUTPUT_FORMAT '(' NAME ',' NAME ',' NAME ')'
288 { lang_add_output_format ($3, $5, $7, 1); }
289 | OUTPUT_ARCH '(' NAME ')'
290 { ldfile_set_output_arch($3); }
291 | FORCE_COMMON_ALLOCATION
292 { command_line.force_common_definition = true ; }
293 | INPUT '(' input_list ')'
294 | GROUP
295 { lang_enter_group (); }
296 '(' input_list ')'
297 { lang_leave_group (); }
298 | MAP '(' filename ')'
299 { lang_add_map($3); }
300 | INCLUDE filename
301 { ldfile_open_command_file($2); } ifile_list END
302 ;
303
304 input_list:
305 NAME
306 { lang_add_input_file($1,lang_input_file_is_search_file_enum,
307 (char *)NULL); }
308 | input_list ',' NAME
309 { lang_add_input_file($3,lang_input_file_is_search_file_enum,
310 (char *)NULL); }
311 | input_list NAME
312 { lang_add_input_file($2,lang_input_file_is_search_file_enum,
313 (char *)NULL); }
314 | LNAME
315 { lang_add_input_file($1,lang_input_file_is_l_enum,
316 (char *)NULL); }
317 | input_list ',' LNAME
318 { lang_add_input_file($3,lang_input_file_is_l_enum,
319 (char *)NULL); }
320 | input_list LNAME
321 { lang_add_input_file($2,lang_input_file_is_l_enum,
322 (char *)NULL); }
323 ;
324
325 sections:
326 SECTIONS '{' sec_or_group_p1 '}'
327 ;
328
329 sec_or_group_p1:
330 sec_or_group_p1 section
331 | sec_or_group_p1 statement_anywhere
332 |
333 ;
334
335 statement_anywhere:
336 ENTRY '(' NAME ')'
337 { lang_add_entry ($3, false); }
338 | assignment end
339 ;
340
341 /* The '*' and '?' cases are there because the lexer returns them as
342 separate tokens rather than as NAME. */
343 file_NAME_list:
344 NAME
345 { lang_add_wild ($1, current_file); }
346 | '*'
347 { lang_add_wild ("*", current_file); }
348 | '?'
349 { lang_add_wild ("?", current_file); }
350 | file_NAME_list opt_comma NAME
351 { lang_add_wild ($3, current_file); }
352 | file_NAME_list opt_comma '*'
353 { lang_add_wild ("*", current_file); }
354 | file_NAME_list opt_comma '?'
355 { lang_add_wild ("?", current_file); }
356 ;
357
358 input_section_spec:
359 NAME
360 {
361 lang_add_wild((char *)NULL, $1);
362 }
363 | '['
364 {
365 current_file = (char *)NULL;
366 }
367 file_NAME_list
368 ']'
369 | NAME
370 {
371 current_file = $1;
372 }
373 '(' file_NAME_list ')'
374 | '?'
375 /* This case is needed because the lexer returns a
376 single question mark as '?' rather than NAME. */
377 {
378 current_file = "?";
379 }
380 '(' file_NAME_list ')'
381 | '*'
382 {
383 current_file = (char *)NULL;
384 }
385 '(' file_NAME_list ')'
386 ;
387
388 statement:
389 assignment end
390 | CREATE_OBJECT_SYMBOLS
391 {
392 lang_add_attribute(lang_object_symbols_statement_enum);
393 }
394 | ';'
395 | CONSTRUCTORS
396 {
397
398 lang_add_attribute(lang_constructors_statement_enum);
399 }
400 | input_section_spec
401 | length '(' mustbe_exp ')'
402 {
403 lang_add_data((int) $1,$3);
404 }
405
406 | FILL '(' mustbe_exp ')'
407 {
408 lang_add_fill
409 (exp_get_value_int($3,
410 0,
411 "fill value",
412 lang_first_phase_enum));
413 }
414 ;
415
416 statement_list:
417 statement_list statement
418 | statement
419 ;
420
421 statement_list_opt:
422 /* empty */
423 | statement_list
424 ;
425
426 length:
427 QUAD
428 { $$ = $1; }
429 | LONG
430 { $$ = $1; }
431 | SHORT
432 { $$ = $1; }
433 | BYTE
434 { $$ = $1; }
435 ;
436
437 fill_opt:
438 '=' mustbe_exp
439 {
440 $$ = exp_get_value_int($2,
441 0,
442 "fill value",
443 lang_first_phase_enum);
444 }
445 | { $$ = 0; }
446 ;
447
448
449
450 assign_op:
451 PLUSEQ
452 { $$ = '+'; }
453 | MINUSEQ
454 { $$ = '-'; }
455 | MULTEQ
456 { $$ = '*'; }
457 | DIVEQ
458 { $$ = '/'; }
459 | LSHIFTEQ
460 { $$ = LSHIFT; }
461 | RSHIFTEQ
462 { $$ = RSHIFT; }
463 | ANDEQ
464 { $$ = '&'; }
465 | OREQ
466 { $$ = '|'; }
467
468 ;
469
470 end: ';' | ','
471 ;
472
473
474 assignment:
475 NAME '=' mustbe_exp
476 {
477 lang_add_assignment (exp_assop ($2, $1, $3));
478 }
479 | NAME assign_op mustbe_exp
480 {
481 lang_add_assignment (exp_assop ('=', $1,
482 exp_binop ($2,
483 exp_nameop (NAME,
484 $1),
485 $3)));
486 }
487 | PROVIDE '(' NAME '=' mustbe_exp ')'
488 {
489 lang_add_assignment (exp_provide ($3, $5));
490 }
491 ;
492
493
494 opt_comma:
495 ',' | ;
496
497
498 memory:
499 MEMORY '{' memory_spec memory_spec_list '}'
500 ;
501
502 memory_spec_list:
503 memory_spec_list memory_spec
504 | memory_spec_list ',' memory_spec
505 |
506 ;
507
508
509 memory_spec: NAME
510 { region = lang_memory_region_lookup($1); }
511 attributes_opt ':'
512 origin_spec opt_comma length_spec
513
514 ; origin_spec:
515 ORIGIN '=' mustbe_exp
516 { region->current =
517 region->origin =
518 exp_get_vma($3, 0L,"origin", lang_first_phase_enum);
519 }
520 ; length_spec:
521 LENGTH '=' mustbe_exp
522 { region->length = exp_get_vma($3,
523 ~((bfd_vma)0),
524 "length",
525 lang_first_phase_enum);
526 }
527
528
529 attributes_opt:
530 '(' NAME ')'
531 {
532 lang_set_flags(&region->flags, $2);
533 }
534 |
535
536 ;
537
538 startup:
539 STARTUP '(' filename ')'
540 { lang_startup($3); }
541 ;
542
543 high_level_library:
544 HLL '(' high_level_library_NAME_list ')'
545 | HLL '(' ')'
546 { ldemul_hll((char *)NULL); }
547 ;
548
549 high_level_library_NAME_list:
550 high_level_library_NAME_list opt_comma filename
551 { ldemul_hll($3); }
552 | filename
553 { ldemul_hll($1); }
554
555 ;
556
557 low_level_library:
558 SYSLIB '(' low_level_library_NAME_list ')'
559 ; low_level_library_NAME_list:
560 low_level_library_NAME_list opt_comma filename
561 { ldemul_syslib($3); }
562 |
563 ;
564
565 floating_point_support:
566 FLOAT
567 { lang_float(true); }
568 | NOFLOAT
569 { lang_float(false); }
570 ;
571
572
573 mustbe_exp: { ldlex_expression(); }
574 exp
575 { ldlex_popstate(); $$=$2;}
576 ;
577
578 exp :
579 '-' exp %prec UNARY
580 { $$ = exp_unop('-', $2); }
581 | '(' exp ')'
582 { $$ = $2; }
583 | NEXT '(' exp ')' %prec UNARY
584 { $$ = exp_unop((int) $1,$3); }
585 | '!' exp %prec UNARY
586 { $$ = exp_unop('!', $2); }
587 | '+' exp %prec UNARY
588 { $$ = $2; }
589 | '~' exp %prec UNARY
590 { $$ = exp_unop('~', $2);}
591
592 | exp '*' exp
593 { $$ = exp_binop('*', $1, $3); }
594 | exp '/' exp
595 { $$ = exp_binop('/', $1, $3); }
596 | exp '%' exp
597 { $$ = exp_binop('%', $1, $3); }
598 | exp '+' exp
599 { $$ = exp_binop('+', $1, $3); }
600 | exp '-' exp
601 { $$ = exp_binop('-' , $1, $3); }
602 | exp LSHIFT exp
603 { $$ = exp_binop(LSHIFT , $1, $3); }
604 | exp RSHIFT exp
605 { $$ = exp_binop(RSHIFT , $1, $3); }
606 | exp EQ exp
607 { $$ = exp_binop(EQ , $1, $3); }
608 | exp NE exp
609 { $$ = exp_binop(NE , $1, $3); }
610 | exp LE exp
611 { $$ = exp_binop(LE , $1, $3); }
612 | exp GE exp
613 { $$ = exp_binop(GE , $1, $3); }
614 | exp '<' exp
615 { $$ = exp_binop('<' , $1, $3); }
616 | exp '>' exp
617 { $$ = exp_binop('>' , $1, $3); }
618 | exp '&' exp
619 { $$ = exp_binop('&' , $1, $3); }
620 | exp '^' exp
621 { $$ = exp_binop('^' , $1, $3); }
622 | exp '|' exp
623 { $$ = exp_binop('|' , $1, $3); }
624 | exp '?' exp ':' exp
625 { $$ = exp_trinop('?' , $1, $3, $5); }
626 | exp ANDAND exp
627 { $$ = exp_binop(ANDAND , $1, $3); }
628 | exp OROR exp
629 { $$ = exp_binop(OROR , $1, $3); }
630 | DEFINED '(' NAME ')'
631 { $$ = exp_nameop(DEFINED, $3); }
632 | INT
633 { $$ = exp_intop($1); }
634 | SIZEOF_HEADERS
635 { $$ = exp_nameop(SIZEOF_HEADERS,0); }
636
637 | SIZEOF '(' NAME ')'
638 { $$ = exp_nameop(SIZEOF,$3); }
639 | ADDR '(' NAME ')'
640 { $$ = exp_nameop(ADDR,$3); }
641 | ABSOLUTE '(' exp ')'
642 { $$ = exp_unop(ABSOLUTE, $3); }
643 | ALIGN_K '(' exp ')'
644 { $$ = exp_unop(ALIGN_K,$3); }
645 | BLOCK '(' exp ')'
646 { $$ = exp_unop(ALIGN_K,$3); }
647 | NAME
648 { $$ = exp_nameop(NAME,$1); }
649 ;
650
651
652 opt_at:
653 AT '(' exp ')' { $$ = $3; }
654 | { $$ = 0; }
655 ;
656
657 section: NAME { ldlex_expression(); }
658 opt_exp_with_type
659 opt_at { ldlex_popstate (); ldlex_script (); }
660 '{'
661 {
662 lang_enter_output_section_statement($1, $3,
663 sectype,
664 0, 0, 0, $4);
665 }
666 statement_list_opt
667 '}' { ldlex_popstate (); ldlex_expression (); }
668 memspec_opt phdr_opt fill_opt
669 {
670 ldlex_popstate();
671 lang_leave_output_section_statement($13, $11);
672 }
673 opt_comma
674 | /* The GROUP case is just enough to support the gcc
675 svr3.ifile script. It is not intended to be full
676 support. I'm not even sure what GROUP is supposed
677 to mean. */
678 GROUP { ldlex_expression (); }
679 opt_exp_with_type
680 {
681 ldlex_popstate ();
682 lang_add_assignment (exp_assop ('=', ".", $3));
683 }
684 '{' sec_or_group_p1 '}'
685 ;
686
687 type:
688 NOLOAD { sectype = noload_section; }
689 | DSECT { sectype = dsect_section; }
690 | COPY { sectype = copy_section; }
691 | INFO { sectype = info_section; }
692 | OVERLAY { sectype = overlay_section; }
693 ;
694
695 atype:
696 '(' type ')'
697 | /* EMPTY */ { sectype = normal_section; }
698 ;
699
700 opt_exp_with_type:
701 exp atype ':' { $$ = $1; }
702 | atype ':' { $$ = (etree_type *)NULL; }
703 | /* The BIND cases are to support the gcc svr3.ifile
704 script. They aren't intended to implement full
705 support for the BIND keyword. I'm not even sure
706 what BIND is supposed to mean. */
707 BIND '(' exp ')' atype ':' { $$ = $3; }
708 | BIND '(' exp ')' BLOCK '(' exp ')' atype ':'
709 { $$ = $3; }
710 ;
711
712 memspec_opt:
713 '>' NAME
714 { $$ = $2; }
715 | { $$ = "*default*"; }
716 ;
717
718 phdr_opt:
719 /* empty */
720 | phdr_opt ':' NAME
721 {
722 lang_section_in_phdr ($3);
723 }
724 ;
725
726 phdrs:
727 PHDRS '{' phdr_list '}'
728 ;
729
730 phdr_list:
731 /* empty */
732 | phdr_list phdr
733 ;
734
735 phdr:
736 NAME { ldlex_expression (); }
737 phdr_type phdr_qualifiers { ldlex_popstate (); }
738 ';'
739 {
740 lang_new_phdr ($1, $3, $4.filehdr, $4.phdrs, $4.at,
741 $4.flags);
742 }
743 ;
744
745 phdr_type:
746 exp
747 {
748 $$ = $1;
749
750 if ($1->type.node_class == etree_name
751 && $1->type.node_code == NAME)
752 {
753 const char *s;
754 unsigned int i;
755 static const char * const phdr_types[] =
756 {
757 "PT_NULL", "PT_LOAD", "PT_DYNAMIC",
758 "PT_INTERP", "PT_NOTE", "PT_SHLIB",
759 "PT_PHDR"
760 };
761
762 s = $1->name.name;
763 for (i = 0;
764 i < sizeof phdr_types / sizeof phdr_types[0];
765 i++)
766 if (strcmp (s, phdr_types[i]) == 0)
767 {
768 $$ = exp_intop (i);
769 break;
770 }
771 }
772 }
773 ;
774
775 phdr_qualifiers:
776 /* empty */
777 {
778 memset (&$$, 0, sizeof (struct phdr_info));
779 }
780 | NAME phdr_val phdr_qualifiers
781 {
782 $$ = $3;
783 if (strcmp ($1, "FILEHDR") == 0 && $2 == NULL)
784 $$.filehdr = true;
785 else if (strcmp ($1, "PHDRS") == 0 && $2 == NULL)
786 $$.phdrs = true;
787 else if (strcmp ($1, "FLAGS") == 0 && $2 != NULL)
788 $$.flags = $2;
789 else
790 einfo ("%X%P:%S: PHDRS syntax error at `%s'\n", $1);
791 }
792 | AT '(' exp ')' phdr_qualifiers
793 {
794 $$ = $5;
795 $$.at = $3;
796 }
797 ;
798
799 phdr_val:
800 /* empty */
801 {
802 $$ = NULL;
803 }
804 | '(' exp ')'
805 {
806 $$ = $2;
807 }
808 ;
809
810 %%
811 void
812 yyerror(arg)
813 const char *arg;
814 {
815 if (ldfile_assumed_script)
816 einfo ("%P:%s: file format not recognized; treating as linker script\n",
817 ldfile_input_filename);
818 if (error_index > 0 && error_index < ERROR_NAME_MAX)
819 einfo ("%P%F:%S: %s in %s\n", arg, error_names[error_index-1]);
820 else
821 einfo ("%P%F:%S: %s\n", arg);
822 }
This page took 0.064938 seconds and 4 git commands to generate.