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

Re: cross-ld problem on AIX 5.1


Fixes a portability bug.  Code a line or two after this place assumed
that malloc(0) returns non-NULL.

	* elf64-ppc.c (toc_adjusting_stub_needed): Exit early if section
	size is zero.

Index: bfd/elf64-ppc.c
===================================================================
RCS file: /cvs/src/src/bfd/elf64-ppc.c,v
retrieving revision 1.138
diff -u -p -r1.138 elf64-ppc.c
--- bfd/elf64-ppc.c	17 Nov 2003 21:31:11 -0000	1.138
+++ bfd/elf64-ppc.c	18 Nov 2003 04:10:57 -0000
@@ -6566,6 +6566,9 @@ toc_adjusting_stub_needed (struct bfd_li
   if ((isec->flags & SEC_LINKER_CREATED) != 0)
     return 0;
 
+  if (isec->_raw_size == 0)
+    return 0;
+
   /* Hack for linux kernel.  .fixup contains branches, but only back to
      the function that hit an exception.  */
   branch_ok = strcmp (isec->name, ".fixup") == 0;

-- 
Alan Modra
IBM OzLabs - Linux Technology Centre


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