OpenCores
URL https://opencores.org/ocsvn/open8_urisc/open8_urisc/trunk

Subversion Repositories open8_urisc

[/] [open8_urisc/] [trunk/] [gnu/] [binutils/] [ld/] [ldgram.y] - Diff between revs 145 and 157

Go to most recent revision | Show entire file | Details | Blame | View Log

Rev 145 Rev 157
Line 70... Line 70...
  char *name;
  char *name;
  const char *cname;
  const char *cname;
  struct wildcard_spec wildcard;
  struct wildcard_spec wildcard;
  struct wildcard_list *wildcard_list;
  struct wildcard_list *wildcard_list;
  struct name_list *name_list;
  struct name_list *name_list;
 
  struct flag_info_list *flag_info_list;
 
  struct flag_info *flag_info;
  int token;
  int token;
  union etree_union *etree;
  union etree_union *etree;
  struct phdr_info
  struct phdr_info
    {
    {
      bfd_boolean filehdr;
      bfd_boolean filehdr;
Line 91... Line 93...
%type  exp opt_exp_with_type mustbe_exp opt_at phdr_type phdr_val
%type  exp opt_exp_with_type mustbe_exp opt_at phdr_type phdr_val
%type  opt_exp_without_type opt_subalign opt_align
%type  opt_exp_without_type opt_subalign opt_align
%type  fill_opt fill_exp
%type  fill_opt fill_exp
%type  exclude_name_list
%type  exclude_name_list
%type  file_NAME_list
%type  file_NAME_list
 
%type  sect_flag_list
 
%type  sect_flags
%type  memspec_opt casesymlist
%type  memspec_opt casesymlist
%type  memspec_at_opt
%type  memspec_at_opt
%type  wildcard_name
%type  wildcard_name
%type  wildcard_spec
%type  wildcard_spec
%token  INT
%token  INT
Line 148... Line 152...
%token CHIP LIST SECT ABSOLUTE  LOAD NEWLINE ENDWORD ORDER NAMEWORD ASSERT_K
%token CHIP LIST SECT ABSOLUTE  LOAD NEWLINE ENDWORD ORDER NAMEWORD ASSERT_K
%token FORMAT PUBLIC DEFSYMEND BASE ALIAS TRUNCATE REL
%token FORMAT PUBLIC DEFSYMEND BASE ALIAS TRUNCATE REL
%token INPUT_SCRIPT INPUT_MRI_SCRIPT INPUT_DEFSYM CASE EXTERN START
%token INPUT_SCRIPT INPUT_MRI_SCRIPT INPUT_DEFSYM CASE EXTERN START
%token  VERS_TAG VERS_IDENTIFIER
%token  VERS_TAG VERS_IDENTIFIER
%token GLOBAL LOCAL VERSIONK INPUT_VERSION_SCRIPT
%token GLOBAL LOCAL VERSIONK INPUT_VERSION_SCRIPT
%token KEEP ONLY_IF_RO ONLY_IF_RW SPECIAL
%token KEEP ONLY_IF_RO ONLY_IF_RW SPECIAL INPUT_SECTION_FLAGS
%token EXCLUDE_FILE
%token EXCLUDE_FILE
%token CONSTANT
%token CONSTANT
%type  vers_defns
%type  vers_defns
%type  vers_tag
%type  vers_tag
%type  verdep
%type  verdep
Line 435... Line 439...
                wildcard_name
                wildcard_name
                        {
                        {
                          $$.name = $1;
                          $$.name = $1;
                          $$.sorted = none;
                          $$.sorted = none;
                          $$.exclude_name_list = NULL;
                          $$.exclude_name_list = NULL;
 
                          $$.section_flag_list = NULL;
                        }
                        }
        |       EXCLUDE_FILE '(' exclude_name_list ')' wildcard_name
        |       EXCLUDE_FILE '(' exclude_name_list ')' wildcard_name
                        {
                        {
                          $$.name = $5;
                          $$.name = $5;
                          $$.sorted = none;
                          $$.sorted = none;
                          $$.exclude_name_list = $3;
                          $$.exclude_name_list = $3;
 
                          $$.section_flag_list = NULL;
                        }
                        }
        |       SORT_BY_NAME '(' wildcard_name ')'
        |       SORT_BY_NAME '(' wildcard_name ')'
                        {
                        {
                          $$.name = $3;
                          $$.name = $3;
                          $$.sorted = by_name;
                          $$.sorted = by_name;
                          $$.exclude_name_list = NULL;
                          $$.exclude_name_list = NULL;
 
                          $$.section_flag_list = NULL;
                        }
                        }
        |       SORT_BY_ALIGNMENT '(' wildcard_name ')'
        |       SORT_BY_ALIGNMENT '(' wildcard_name ')'
                        {
                        {
                          $$.name = $3;
                          $$.name = $3;
                          $$.sorted = by_alignment;
                          $$.sorted = by_alignment;
                          $$.exclude_name_list = NULL;
                          $$.exclude_name_list = NULL;
 
                          $$.section_flag_list = NULL;
                        }
                        }
        |       SORT_BY_NAME '(' SORT_BY_ALIGNMENT '(' wildcard_name ')' ')'
        |       SORT_BY_NAME '(' SORT_BY_ALIGNMENT '(' wildcard_name ')' ')'
                        {
                        {
                          $$.name = $5;
                          $$.name = $5;
                          $$.sorted = by_name_alignment;
                          $$.sorted = by_name_alignment;
                          $$.exclude_name_list = NULL;
                          $$.exclude_name_list = NULL;
 
                          $$.section_flag_list = NULL;
                        }
                        }
        |       SORT_BY_NAME '(' SORT_BY_NAME '(' wildcard_name ')' ')'
        |       SORT_BY_NAME '(' SORT_BY_NAME '(' wildcard_name ')' ')'
                        {
                        {
                          $$.name = $5;
                          $$.name = $5;
                          $$.sorted = by_name;
                          $$.sorted = by_name;
                          $$.exclude_name_list = NULL;
                          $$.exclude_name_list = NULL;
 
                          $$.section_flag_list = NULL;
                        }
                        }
        |       SORT_BY_ALIGNMENT '(' SORT_BY_NAME '(' wildcard_name ')' ')'
        |       SORT_BY_ALIGNMENT '(' SORT_BY_NAME '(' wildcard_name ')' ')'
                        {
                        {
                          $$.name = $5;
                          $$.name = $5;
                          $$.sorted = by_alignment_name;
                          $$.sorted = by_alignment_name;
                          $$.exclude_name_list = NULL;
                          $$.exclude_name_list = NULL;
 
                          $$.section_flag_list = NULL;
                        }
                        }
        |       SORT_BY_ALIGNMENT '(' SORT_BY_ALIGNMENT '(' wildcard_name ')' ')'
        |       SORT_BY_ALIGNMENT '(' SORT_BY_ALIGNMENT '(' wildcard_name ')' ')'
                        {
                        {
                          $$.name = $5;
                          $$.name = $5;
                          $$.sorted = by_alignment;
                          $$.sorted = by_alignment;
                          $$.exclude_name_list = NULL;
                          $$.exclude_name_list = NULL;
 
                          $$.section_flag_list = NULL;
                        }
                        }
        |       SORT_BY_NAME '(' EXCLUDE_FILE '(' exclude_name_list ')' wildcard_name ')'
        |       SORT_BY_NAME '(' EXCLUDE_FILE '(' exclude_name_list ')' wildcard_name ')'
                        {
                        {
                          $$.name = $7;
                          $$.name = $7;
                          $$.sorted = by_name;
                          $$.sorted = by_name;
                          $$.exclude_name_list = $5;
                          $$.exclude_name_list = $5;
 
                          $$.section_flag_list = NULL;
                        }
                        }
        |       SORT_BY_INIT_PRIORITY '(' wildcard_name ')'
        |       SORT_BY_INIT_PRIORITY '(' wildcard_name ')'
                        {
                        {
                          $$.name = $3;
                          $$.name = $3;
                          $$.sorted = by_init_priority;
                          $$.sorted = by_init_priority;
                          $$.exclude_name_list = NULL;
                          $$.exclude_name_list = NULL;
 
                          $$.section_flag_list = NULL;
 
                        }
 
        ;
 
 
 
sect_flag_list: NAME
 
                        {
 
                          struct flag_info_list *n;
 
                          n = ((struct flag_info_list *) xmalloc (sizeof *n));
 
                          if ($1[0] == '!')
 
                            {
 
                              n->with = without_flags;
 
                              n->name = &$1[1];
 
                            }
 
                          else
 
                            {
 
                              n->with = with_flags;
 
                              n->name = $1;
 
                            }
 
                          n->valid = FALSE;
 
                          n->next = NULL;
 
                          $$ = n;
 
                        }
 
        |       sect_flag_list '&' NAME
 
                        {
 
                          struct flag_info_list *n;
 
                          n = ((struct flag_info_list *) xmalloc (sizeof *n));
 
                          if ($3[0] == '!')
 
                            {
 
                              n->with = without_flags;
 
                              n->name = &$3[1];
 
                            }
 
                          else
 
                            {
 
                              n->with = with_flags;
 
                              n->name = $3;
 
                            }
 
                          n->valid = FALSE;
 
                          n->next = $1;
 
                          $$ = n;
 
                        }
 
        ;
 
 
 
sect_flags:
 
                INPUT_SECTION_FLAGS '(' sect_flag_list ')'
 
                        {
 
                          struct flag_info *n;
 
                          n = ((struct flag_info *) xmalloc (sizeof *n));
 
                          n->flag_list = $3;
 
                          n->flags_initialized = FALSE;
 
                          n->not_with_flags = 0;
 
                          n->only_with_flags = 0;
 
                          $$ = n;
                        }
                        }
        ;
        ;
 
 
exclude_name_list:
exclude_name_list:
                exclude_name_list wildcard_name
                exclude_name_list wildcard_name
Line 539... Line 604...
                        {
                        {
                          struct wildcard_spec tmp;
                          struct wildcard_spec tmp;
                          tmp.name = $1;
                          tmp.name = $1;
                          tmp.exclude_name_list = NULL;
                          tmp.exclude_name_list = NULL;
                          tmp.sorted = none;
                          tmp.sorted = none;
 
                          tmp.section_flag_list = NULL;
 
                          lang_add_wild (&tmp, NULL, ldgram_had_keep);
 
                        }
 
        |       sect_flags NAME
 
                        {
 
                          struct wildcard_spec tmp;
 
                          tmp.name = $2;
 
                          tmp.exclude_name_list = NULL;
 
                          tmp.sorted = none;
 
                          tmp.section_flag_list = $1;
                          lang_add_wild (&tmp, NULL, ldgram_had_keep);
                          lang_add_wild (&tmp, NULL, ldgram_had_keep);
                        }
                        }
        |       '[' file_NAME_list ']'
        |       '[' file_NAME_list ']'
                        {
                        {
                          lang_add_wild (NULL, $2, ldgram_had_keep);
                          lang_add_wild (NULL, $2, ldgram_had_keep);
                        }
                        }
 
        |       sect_flags '[' file_NAME_list ']'
 
                        {
 
                          struct wildcard_spec tmp;
 
                          tmp.name = NULL;
 
                          tmp.exclude_name_list = NULL;
 
                          tmp.sorted = none;
 
                          tmp.section_flag_list = $1;
 
                          lang_add_wild (NULL, $3, ldgram_had_keep);
 
                        }
        |       wildcard_spec '(' file_NAME_list ')'
        |       wildcard_spec '(' file_NAME_list ')'
                        {
                        {
                          lang_add_wild (&$1, $3, ldgram_had_keep);
                          lang_add_wild (&$1, $3, ldgram_had_keep);
                        }
                        }
 
        |       sect_flags wildcard_spec '(' file_NAME_list ')'
 
                        {
 
                          $2.section_flag_list = $1;
 
                          lang_add_wild (&$2, $4, ldgram_had_keep);
 
                        }
        ;
        ;
 
 
input_section_spec:
input_section_spec:
                input_section_spec_no_keep
                input_section_spec_no_keep
        |       KEEP '('
        |       KEEP '('

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.