This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: non-representable symbols in PE executables
- From: Alan Modra <amodra at gmail dot com>
- To: Jan Beulich <JBeulich at suse dot com>
- Cc: binutils at sourceware dot org
- Date: Mon, 4 Jul 2016 11:41:09 +0930
- Subject: Re: non-representable symbols in PE executables
- Authentication-results: sourceware.org; auth=none
- References: <5772377502000078000F942F at prv-mh dot provo dot novell dot com>
On Tue, Jun 28, 2016 at 12:38:13AM -0600, Jan Beulich wrote:
> --- a/ld/ldexp.c
> +++ b/ld/ldexp.c
> @@ -1181,7 +1181,7 @@ exp_fold_tree_1 (etree_type *tree)
> h->type = bfd_link_hash_defined;
> h->u.def.value = expld.result.value;
> h->u.def.section = expld.result.section;
> - h->linker_def = 0;
> + h->linker_def = ! tree->assign.type.lineno;
> if (tree->type.node_class == etree_provide)
> tree->type.node_class = etree_provided;
>
linker_def is supposed to indicate that a symbol is a built-in define,
ie. defined somewhat magically by the linker rather than by an object
file, linker script, or on the command line. Please convince me that
lineno is always non-zero when parsing a script or the command line,
and always zero otherwise. I'm particularly interested in what
happens on the first line of a script.
> --- a/ld/ldlex.l
> +++ b/ld/ldlex.l
> @@ -39,9 +39,8 @@
> yylex and yyparse (indirectly) both check this. */
> input_type parser_input;
>
> -/* Line number in the current input file.
> - (FIXME Actually, it doesn't appear to get reset for each file?) */
> -unsigned int lineno = 1;
> +/* Line number in the current input file. */
> +unsigned int lineno;
>
> /* The string we are currently lexing, or NULL if we are reading a
> file. */
> @@ -459,7 +458,10 @@ V_IDENTIFIER [*?.$_a-zA-Z\[\]\-\!\^\\]([
> <<EOF>> {
> include_stack_ptr--;
> if (include_stack_ptr == 0)
> - yyterminate ();
> + {
> + lineno = 0;
> + yyterminate ();
> + }
> else
> yy_switch_to_buffer (include_stack[include_stack_ptr]);
>
>
--
Alan Modra
Australia Development Lab, IBM