Fix NOCROSSREFS 3 for MIPS Linux

Daniel Jacobowitz drow@false.org
Wed Sep 19 17:08:00 GMT 2007


This obvious patch prevents ld from crashing when .got is non-empty
but DISCARD'd.  Not a very useful thing to do for real binaries, but
used in ld testing.  Checked in.

-- 
Daniel Jacobowitz
CodeSourcery

2007-09-19  Daniel Jacobowitz  <dan@codesourcery.com>

	* elfxx-mips.c (_bfd_mips_elf_finish_dynamic_sections): Make sure .got
	will be output.

Index: elfxx-mips.c
===================================================================
--- elfxx-mips.c	(revision 181978)
+++ elfxx-mips.c	(working copy)
@@ -8917,7 +8917,8 @@ _bfd_mips_elf_finish_dynamic_sections (b
 	memset (b - dyn_skipped, 0, dyn_skipped);
     }
 
-  if (sgot != NULL && sgot->size > 0)
+  if (sgot != NULL && sgot->size > 0
+      && !bfd_is_abs_section (sgot->output_section))
     {
       if (htab->is_vxworks)
 	{



More information about the Binutils mailing list