This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
Objcopy (bfd) segfault
- To: binutils at gcc dot gnu dot org
- Subject: Objcopy (bfd) segfault
- From: David Robins <dbrobins at student dot math dot uwaterloo dot ca>
- Date: Fri, 22 Jun 2001 19:00:26 -0400 (EDT)
In converting an elf (32-bit, linux, i386) object file (generated by
egcs-2.91.66) to a.out, I got a core dump using the following command line:
objcopy -R .note -R .rodata -R .comment -O a.out-i386 kernel.o
(Binutils version 2.11. Same error if I use -O a.out-i386-linux.)
I traced it down to aoutx.h, in NAME(aout,swap_std_reloc_out) i.e.
aout_32_swap_std_reloc_out. output_section is NULL and it segfaults in
if (bfd_is_com_section (output_section)
|| bfd_is_abs_section (output_section)
|| bfd_is_und_section (output_section)),
around line 2050. I patched it temporarily by inserting
if (!output_section) return;
right after
asection *output_section = sym->section->output_section;
earlier in the function, which works, but probably isn't the best solution.
Despite the filename, there's nothing "tricky" going on in the object file
that should of itself produce an error.
(Please Cc: responses to my email address, I don't read the list.)
Thanks,
Dave
Isa. 40:31