GNU Binutils with patches for OS216
リビジョン | 1753ed681125949b081376dd97056a3f2930e7d7 (tree) |
---|---|
日時 | 2016-07-05 18:36:08 |
作者 | Jan Beulich <jbeulich@nove...> |
コミッター | Jan Beulich |
ld: track linker-definedness of symbols
Keep "lineno" as zero while not processing any script, and use it being
zero to set the "linker_def" field to true.
@@ -1,3 +1,10 @@ | ||
1 | +2016-07-05 Jan Beulich <jbeulich@suse.com> | |
2 | + | |
3 | + * ldexp.c (exp_fold_tree_1): Set linker_def field based on | |
4 | + assignment line number. | |
5 | + * ldlex.l (lineno): Drop initializer. | |
6 | + (<<EOF>>): Set lineno to zero after reaching top of stack. | |
7 | + | |
1 | 8 | 2016-07-04 H.J. Lu <hongjiu.lu@intel.com> |
2 | 9 | |
3 | 10 | PR ld/20321 |
@@ -1182,7 +1182,7 @@ exp_fold_tree_1 (etree_type *tree) | ||
1182 | 1182 | h->type = bfd_link_hash_defined; |
1183 | 1183 | h->u.def.value = expld.result.value; |
1184 | 1184 | h->u.def.section = expld.result.section; |
1185 | - h->linker_def = 0; | |
1185 | + h->linker_def = ! tree->assign.type.lineno; | |
1186 | 1186 | if (tree->type.node_class == etree_provide) |
1187 | 1187 | tree->type.node_class = etree_provided; |
1188 | 1188 |
@@ -39,9 +39,8 @@ | ||
39 | 39 | yylex and yyparse (indirectly) both check this. */ |
40 | 40 | input_type parser_input; |
41 | 41 | |
42 | -/* Line number in the current input file. | |
43 | - (FIXME Actually, it doesn't appear to get reset for each file?) */ | |
44 | -unsigned int lineno = 1; | |
42 | +/* Line number in the current input file. */ | |
43 | +unsigned int lineno; | |
45 | 44 | |
46 | 45 | /* The string we are currently lexing, or NULL if we are reading a |
47 | 46 | file. */ |
@@ -460,7 +459,10 @@ V_IDENTIFIER [*?.$_a-zA-Z\[\]\-\!\^\\]([*?.$_a-zA-Z0-9\[\]\-\!\^\\]|::)* | ||
460 | 459 | <<EOF>> { |
461 | 460 | include_stack_ptr--; |
462 | 461 | if (include_stack_ptr == 0) |
463 | - yyterminate (); | |
462 | + { | |
463 | + lineno = 0; | |
464 | + yyterminate (); | |
465 | + } | |
464 | 466 | else |
465 | 467 | yy_switch_to_buffer (include_stack[include_stack_ptr]); |
466 | 468 |