This is the mail archive of the binutils-cvs@sourceware.org mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[binutils-gdb] ld insert_os_after ignoring first assignment


https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=7358942661ccb0ea1e819fd2f5d47914cebf0aa2

commit 7358942661ccb0ea1e819fd2f5d47914cebf0aa2
Author: Alan Modra <amodra@gmail.com>
Date:   Mon Oct 8 08:44:50 2018 +1030

    ld insert_os_after ignoring first assignment
    
    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.

Diff:
---
 ld/ChangeLog                  |  7 +++++++
 ld/ldlang.c                   | 11 +++++++----
 ld/testsuite/ld-elf/pr19539.d |  2 +-
 3 files changed, 15 insertions(+), 5 deletions(-)

diff --git a/ld/ChangeLog b/ld/ChangeLog
index 7356c2b..55efbbf 100644
--- a/ld/ChangeLog
+++ b/ld/ChangeLog
@@ -1,5 +1,12 @@
 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.
 
 2018-10-05  Richard Henderson  <rth@twiddle.net>
diff --git a/ld/ldlang.c b/ld/ldlang.c
index 1a27787..0041f57 100644
--- a/ld/ldlang.c
+++ b/ld/ldlang.c
@@ -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)
diff --git a/ld/testsuite/ld-elf/pr19539.d b/ld/testsuite/ld-elf/pr19539.d
index 5153229..04e6791 100644
--- a/ld/testsuite/ld-elf/pr19539.d
+++ b/ld/testsuite/ld-elf/pr19539.d
@@ -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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]