aboutsummaryrefslogtreecommitdiff
path: root/ld/ldgram.y
diff options
context:
space:
mode:
authorAlan Modra <amodra@gmail.com>2001-08-03 01:11:21 +0000
committerAlan Modra <amodra@gmail.com>2001-08-03 01:11:21 +0000
commitb6bf44ba1b497f5cf654851f6c360313b05345f4 (patch)
tree5be7e5d3400049da73ac4aa53d8a966f2baed81f /ld/ldgram.y
parent6b8772f1c70017e6adf2db2db687b692a5dd5416 (diff)
downloadbinutils-b6bf44ba1b497f5cf654851f6c360313b05345f4.zip
binutils-b6bf44ba1b497f5cf654851f6c360313b05345f4.tar.gz
binutils-b6bf44ba1b497f5cf654851f6c360313b05345f4.tar.bz2
* ld.texinfo (Input Section Basics): Clarify ordering of output
sections. * ldlang.c (callback_t): Add wildcard_list param. (walk_wild_section): Remove "section" param. Rewrite for lang_wild_statement_type change. Remove unique_section_p test. (walk_wild_file): Remove "section" param. (walk_wild): Remove "section" and "file" params. (lang_gc_wild): Likewise. (wild): Likewise. Modify for lang_wild_statement_type change. (wild_sort): Likewise. Add "sec" param. (gc_section_callback): Likewise. (output_section_callback): Likewise. Do unique_section_p test. (map_input_to_output_sections): Modify call to wild. (lang_gc_sections_1): Likewise. (print_wild_statement): Modify for lang_wild_statement_type change. (lang_add_wild): Replace filename, filenames_sorted param with filespec. Replace section_name, sections_sorted, exclude_filename_list with section_list. * ldlang.h (lang_add_wild): Here too. (lang_wild_statement_type): Replace section_name, sections_sorted, and exclude_filename_list with section_list. * ldgram.y (current_file): Delete. (%union): Add wildcard_list. (file_NAME_list): Set type to wildcard_list. Build a linked list rather than calling lang_add_wild for each entry. (input_section_spec_no_keep): Call lang_add_wild here instead. * ld.h (struct wildcard_list): Declare. * mri.c (mri_draw_tree): Modify to suit new lang_add_wild.
Diffstat (limited to 'ld/ldgram.y')
-rw-r--r--ld/ldgram.y49
1 files changed, 24 insertions, 25 deletions
diff --git a/ld/ldgram.y b/ld/ldgram.y
index e7f4a59..5e9fd62 100644
--- a/ld/ldgram.y
+++ b/ld/ldgram.y
@@ -49,7 +49,6 @@ static enum section_type sectype;
lang_memory_region_type *region;
-struct wildcard_spec current_file;
boolean ldgram_want_filename = true;
boolean had_script = false;
boolean force_make_executable = false;
@@ -70,6 +69,7 @@ static int error_index;
char *name;
const char *cname;
struct wildcard_spec wildcard;
+ struct wildcard_list *wildcard_list;
struct name_list *name_list;
int token;
union etree_union *etree;
@@ -91,6 +91,7 @@ static int error_index;
%type <etree> opt_exp_without_type
%type <integer> fill_opt
%type <name_list> exclude_name_list
+%type <wildcard_list> file_NAME_list
%type <name> memspec_opt casesymlist
%type <name> memspec_at_opt
%type <cname> wildcard_name
@@ -417,8 +418,6 @@ wildcard_spec:
}
;
-
-
exclude_name_list:
exclude_name_list wildcard_name
{
@@ -440,42 +439,42 @@ exclude_name_list:
;
file_NAME_list:
- wildcard_spec
+ file_NAME_list opt_comma wildcard_spec
{
- lang_add_wild ($1.name, $1.sorted,
- current_file.name,
- current_file.sorted,
- ldgram_had_keep, $1.exclude_name_list);
+ struct wildcard_list *tmp;
+ tmp = (struct wildcard_list *) xmalloc (sizeof *tmp);
+ tmp->next = $1;
+ tmp->spec = $3;
+ $$ = tmp;
}
- | file_NAME_list opt_comma wildcard_spec
+ |
+ wildcard_spec
{
- lang_add_wild ($3.name, $3.sorted,
- current_file.name,
- current_file.sorted,
- ldgram_had_keep, $3.exclude_name_list);
+ struct wildcard_list *tmp;
+ tmp = (struct wildcard_list *) xmalloc (sizeof *tmp);
+ tmp->next = NULL;
+ tmp->spec = $1;
+ $$ = tmp;
}
;
input_section_spec_no_keep:
NAME
{
- lang_add_wild (NULL, false, $1, false,
- ldgram_had_keep, NULL);
+ struct wildcard_spec tmp;
+ tmp.name = $1;
+ tmp.exclude_name_list = NULL;
+ tmp.sorted = false;
+ lang_add_wild (&tmp, NULL, ldgram_had_keep);
}
- | '['
+ | '[' file_NAME_list ']'
{
- current_file.name = NULL;
- current_file.sorted = false;
+ lang_add_wild (NULL, $2, ldgram_had_keep);
}
- file_NAME_list ']'
- | wildcard_spec
+ | wildcard_spec '(' file_NAME_list ')'
{
- current_file = $1;
- /* '*' matches any file name. */
- if (strcmp (current_file.name, "*") == 0)
- current_file.name = NULL;
+ lang_add_wild (&$1, $3, ldgram_had_keep);
}
- '(' file_NAME_list ')'
;
input_section_spec: