This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
Re: cross-ld problem on AIX 5.1
- From: Alan Modra <amodra at bigpond dot net dot au>
- To: binutils at sources dot redhat dot com
- Cc: Michal Ostrowski <mostrows at watson dot ibm dot com>
- Date: Tue, 18 Nov 2003 14:43:16 +1030
- Subject: Re: cross-ld problem on AIX 5.1
- References: <1069118719.1784.25112.camel@brick.watson.ibm.com>
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