This is the mail archive of the binutils@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]

PATCH: PR ld/5670: linker is broken


I am checking this patch to silence gcc 4.1 alias warning. Tested
with gcc 4.1/3.4 on Linux/Intel64/ia32 as well as cross linker
to spu-elf.

H.J.
---
2008-01-25  H.J. Lu  <hongjiu.lu@intel.com>

	PR ld/5670
	* ldlang.c (process_insert_statements): Silence gcc 4.1 alias
	warning.

--- ld/ldlang.c.aaa	2008-01-25 09:22:01.000000000 -0800
+++ ld/ldlang.c	2008-01-25 09:23:14.000000000 -0800
@@ -3390,19 +3390,26 @@ process_insert_statements (void)
 	  if (last_os != NULL)
 	    {
 	      asection *first_sec, *last_sec;
+	      struct lang_output_section_statement_struct **next;
 
 	      /* Snip out the output sections we are moving.  */
 	      first_os->prev->next = last_os->next;
 	      if (last_os->next == NULL)
-		lang_output_section_statement.tail
-		  = (union lang_statement_union **) &first_os->prev->next;
+		{
+		  next = &first_os->prev->next;
+		  lang_output_section_statement.tail
+		    = (lang_statement_union_type **) next;
+		}
 	      else
 		last_os->next->prev = first_os->prev;
 	      /* Add them in at the new position.  */
 	      last_os->next = where->next;
 	      if (where->next == NULL)
-		lang_output_section_statement.tail
-		  = (union lang_statement_union **) &last_os->next;
+		{
+		  next = &last_os->next;
+		  lang_output_section_statement.tail
+		    = (lang_statement_union_type **) next;
+		}
 	      else
 		where->next->prev = last_os;
 	      first_os->prev = where;


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