RE: objcopy error -- was RE: your mail

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

 



On Thu, 4 Jan 2001, John Van Horne wrote:

> This is the same script that worked fine when we were using 
> egcs-mips-linux-1.0.3a and binutils-mips-linux-2.8.1.  Have
> there been any changes in the linker that would affect how
> we write our linker script?

 It's possible the linker emits unnecessary sections.  Try the following
patch to see if it helps.

-- 
+  Maciej W. Rozycki, Technical University of Gdansk, Poland   +
+--------------------------------------------------------------+
+        e-mail: macro@ds2.pg.gda.pl, PGP key available        +

2000-11-30  Ralf Baechle  <ralf@gnu.org>

        * elf32-mips.c (elf32_mips_merge_private_bfd_data): Always permit
        BFDs containing no sections or empty .text, .data or .bss sections
	to be merged, regardless of their flags.

diff -urN binutils-cygnus/bfd/elf32-mips.c binutils/bfd/elf32-mips.c
--- binutils-cygnus/bfd/elf32-mips.c	Sat Oct 14 14:21:14 2000
+++ binutils/bfd/elf32-mips.c	Thu Nov 30 16:13:09 2000
@@ -2475,6 +2475,8 @@
   flagword old_flags;
   flagword new_flags;
   boolean ok;
+  boolean null_input_bfd = true;
+  asection *sec;
 
   /* Check if we have the same endianess */
   if (_bfd_generic_verify_endian_match (ibfd, obfd) == false)
@@ -2512,6 +2514,27 @@
   old_flags &= ~EF_MIPS_NOREORDER;
 
   if (new_flags == old_flags)
+    return true;
+
+  /* Check to see if the input BFD actually contains any sections.
+     If not, its flags may not have been initialised either, but it cannot
+     actually cause any incompatibility.  */
+  for (sec = ibfd->sections; sec != NULL; sec = sec->next)
+    {
+      /* Ignore synthetic sections and empty .text, .data and .bss sections
+	  which are automatically generated by gas.  */
+      if (strcmp (sec->name, ".reginfo")
+	  && strcmp (sec->name, ".mdebug")
+	  && ((!strcmp (sec->name, ".text")
+	       || !strcmp (sec->name, ".data")
+	       || !strcmp (sec->name, ".bss"))
+	      && sec->_raw_size != 0))
+	{
+	  null_input_bfd = false;
+	  break;
+	}
+    }
+  if (null_input_bfd)
     return true;
 
   ok = true;



[Index of Archives]     [Linux MIPS Home]     [LKML Archive]     [Linux ARM Kernel]     [Linux ARM]     [Linux]     [Git]     [Yosemite News]     [Linux SCSI]     [Linux Hams]

  Powered by Linux