This is the mail archive of the binutils@sourceware.cygnus.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]

Re: patch for bfd/dwarf2.c, problem if .debug_info section was relocated


   Date: Tue, 22 Feb 2000 21:40:28 +0100
   From: Stephane Carrez <Stephane.Carrez@worldnet.fr>

   I've found a small problem in bfd/dwarf2.c. If I wrote a linker
   script that had all the *(.debug_info) sections at beginning, and I had
   some undefined symbols during the link, the linker would abort without
   any message.

   If I write such bad linker script, the .debug_info sections gets relocated
   before the undefined symbols are reported. In bfd/dwarf2.c, we call
   'bfd_get_section_size_before_reloc' which aborts.

   I propose the following fix that checks this situation before aborting
   and print an error message. We also don't need to abort: in that case
   the dwarf-2 debugging info can simply be ignored. The linker will print
   the undefined symbol without the file/line information.

I checked in a different patch: to just use _raw_size rather than
bfd_get_section_size_before_reloc.

The dwarf2 code always wants the size of the section in the input BFD.
It doesn't care about the relocated size, and it doesn't care about
what happens to the section during the linking process.  It was a bug
for the code to call bfd_get_section_size_before_reloc.

Ian

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