[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Bug ld/24730] INCLUDE and --default-script / --script have different wh

From: nickc at redhat dot com
Subject: [Bug ld/24730] INCLUDE and --default-script / --script have different whitespace behavior when using REGION_ALIAS
Date: Fri, 28 Jun 2019 16:17:56 +0000


Nick Clifton <nickc at redhat dot com> changed:

           What    |Removed                     |Added
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2019-06-28
                 CC|                            |nickc at redhat dot com
     Ever confirmed|0                           |1

--- Comment #2 from Nick Clifton <nickc at redhat dot com> ---
Hi Pekka,

> For some reason ld behaves differently when parsing input script files that
> originate from a INCLUDE command than those which are given as command line
> arguments, at least when using REGION_ALIAS.

Well I can give you a general answer, which is that the lexical context
is different when parsing the contents of a file included via the INCLUDE
directive, to when parsing a file brought in by the --script option.
(Exactly what is different, and why it is happening I do not know. :-(

> works as expected.  What I don't really understand is that why REGION_ALIAS
> is affected, but e.g. OUTPUT_FORMAT is not.

Which form of OUTPUT_FORMAT ?  The one with one argument or the one with 
three arguments ?

The problem I think is that "syntax error" being referred to is the fact
that the comma is next to the start of the second name in the REGION_ALIAS
directive.  Ie the parser thinks that:

  REGION_ALIAS("region1wn" ,region1);

contains two names, the first called "region1wn" and the second called
",region1".  (Ie starting with a comma, and with no character separating 
the two names).  For some reason the lexer is treating the comma as a 
valid name starting character.

By the way, this does suggest a workaround for the problem.  If you change
lines 7 and 8 of region1.ld to be:

  /* line 7 */ REGION_ALIAS("region1wn" ,"region1");
  /* line 8 */ REGION_ALIAS("region1nn","region1");

Then the script fragment will work.


You are receiving this mail because:
You are on the CC list for the bug.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]