ld insert_os_after ignoring first assignment
authorAlan Modra <amodra@gmail.com>
Sun, 7 Oct 2018 22:14:50 +0000 (08:44 +1030)
committerAlan Modra <amodra@gmail.com>
Mon, 8 Oct 2018 09:56:08 +0000 (20:26 +1030)
Some time ago the pr19593 test was xfailed for alpha.  This turned out
to be the wrong course of action since the test exposed a bug in
orphan section placement.  On alpha, orphan sections were being
inserted before ". = SIZEOF_HEADERS" due to the test having two
assignments, and on alpha, an output section statement from
-Ttext-segment being passed to ld.

* ldlang.c (insert_os_after): Clear ignore_first on assignment to
dot, not any assignment.  Clear ignore_first on output section
statement contents too.
* testsuite/ld-elf/pr19539.d: Remove alpha xfail.

ld/ChangeLog
ld/ldlang.c
ld/testsuite/ld-elf/pr19539.d

index 7356c2b81062c9b0b5fe5e9d01a5d850344b9061..55efbbfb17a2f59002821559593ce92363acd743 100644 (file)
@@ -1,3 +1,10 @@
+2018-10-08  Alan Modra  <amodra@gmail.com>
+
+       * ldlang.c (insert_os_after): Clear ignore_first on assignment to
+       dot, not any assignment.  Clear ignore_first on output section
+       statement contents too.
+       * testsuite/ld-elf/pr19539.d: Remove alpha xfail.
+
 2018-10-08  Alan Modra  <amodra@gmail.com>
 
        * testsuite/ld-elf/pr22423.d: Pass --dynamic-linker to ld.
index 1a277871932c1870c9474508284c8a04bc9db7c3..0041f57116d75b49f3c83f796759aff7284be3b9 100644 (file)
@@ -1777,11 +1777,13 @@ insert_os_after (lang_output_section_statement_type *after)
              ass = &(*where)->assignment_statement;
              if (ass->exp->type.node_class != etree_assert
                  && ass->exp->assign.dst[0] == '.'
-                 && ass->exp->assign.dst[1] == 0
-                 && !ignore_first)
-               assign = where;
+                 && ass->exp->assign.dst[1] == 0)
+               {
+                 if (!ignore_first)
+                   assign = where;
+                 ignore_first = FALSE;
+               }
            }
-         ignore_first = FALSE;
          continue;
        case lang_wild_statement_enum:
        case lang_input_section_enum:
@@ -1792,6 +1794,7 @@ insert_os_after (lang_output_section_statement_type *after)
        case lang_padding_statement_enum:
        case lang_constructors_statement_enum:
          assign = NULL;
+         ignore_first = FALSE;
          continue;
        case lang_output_section_statement_enum:
          if (assign != NULL)
index 5153229ecfb85303e5f6588dfafd4b4387600b87..04e6791406c878df92b050c5af422f24a0b864bb 100644 (file)
@@ -3,7 +3,7 @@
 #ld: -pie -T pr19539.t
 #readelf : --dyn-syms --wide
 #target: *-*-linux* *-*-gnu* *-*-solaris* arm*-*-uclinuxfdpiceabi
-#xfail: cris*-*-* alpha-*-*
+#xfail: cris*-*-*
 
 Symbol table '\.dynsym' contains [0-9]+ entr(y|ies):
 #pass
This page took 0.030946 seconds and 4 git commands to generate.