From mboxrd@z Thu Jan 1 00:00:00 1970 Message-ID: <199704291757.NAA02793@sanguine.cygnus.com> Date: Tue, 29 Apr 1997 13:57:07 -0400 From: Ian Lance Taylor Subject: Re: patch for strip In-Reply-To: <199704252329.SAA11727@twiddle.rth.home> From: Richard Henderson Date: Fri, 25 Apr 1997 18:29:30 -0500 (CDT) I'm not sure what changed to expose this, but the first phdr is the phdr itself, and so naturally doesn't contain any sections. Fri Apr 25 18:25:36 1997 Richard Henderson * elf.c (copy_private_bfd_data): Continue early if the phdr doesn't contain any sections. --- binutils-2.7.0.16/bfd/elf.c.orig Fri Apr 25 18:00:34 1997 +++ binutils-2.7.0.16/bfd/elf.c Fri Apr 25 18:12:18 1997 @@ -3144,6 +3144,9 @@ copy_private_bfd_data (ibfd, obfd) && s->output_section != NULL) ++csecs; + if (csecs == 0) + continue; + m = ((struct elf_segment_map *) bfd_alloc (obfd, (sizeof (struct elf_segment_map) This patch isn't right. The code in question is copying the list of program headers from the input file to the output file. This is intended to make objcopy and strip use the same set of program headers for both files. As far as I can see, the code works correctly when csecs is 0. If you look at the bfd_alloc call, it does not pass in 0 even when csecs is 0. Even if it did, bfd_alloc does not return NULL when passed 0. I'm not sure what the problem is here, but I think it must be elsewhere. Ian -- To unsubscribe: send e-mail to axp-list-request@redhat.com with 'unsubscribe' as the subject. Do not send it to axp-list@redhat.com