Objcopy (bfd) segfault
David Robins
dbrobins@student.math.uwaterloo.ca
Fri Jun 22 16:00:00 GMT 2001
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
More information about the Binutils
mailing list