bug-gnu-utils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

(ld) bfd_abs_section in .rodata, but modified


From: Petr Ledvina
Subject: (ld) bfd_abs_section in .rodata, but modified
Date: Wed, 14 Nov 2001 23:15:22 +0100 (MET)

I just encoutered bug in ld for h8300:
GNU ld 2.11.2
  Supported emulations:
   h8300
   h8300h
   h8300s
compiled using gcc 2.95.4.

When I try to link against some absolute file(h8300-coff) using
--just-symbols=<absolute file>, ld crashes with segfault.

It seems that  bfd_abs_section is defined const (and gcc puts it in
.rodata), but coff_count_linenumbers tries to modify it.

Backtrace:
#0  0x8077353 in coff_count_linenumbers (abfd=0x80b6af0)
    at ../../binutils-2.11.2/bfd/coffgen.c:542
#1  0x8074bc2 in coff_write_object_contents (abfd=0x80b6af0)
    at ../../binutils-2.11.2/bfd/coffcode.h:3306
#2  0x80661a3 in bfd_close (abfd=0x80b6af0)
    at ../../binutils-2.11.2/bfd/opncls.c:413
#3  0x80591be in main (argc=75, argv=0xbffff524)
    at ../../binutils-2.11.2/ld/ldmain.c:399

Source (in cofgen.c):
            {
              /* This symbol has line numbers.  Increment the owning
                 section's linenumber count.  */
              alent *l = q->lineno;

=>            ++q->symbol.section->output_section->lineno_count;
              ++total;
              ++l;
              while (l->line_number != 0)
                {
                  ++total;
                  ++q->symbol.section->output_section->lineno_count;
                  ++l;
                }
            }

q->symbol.section->output_section points to <bfd_abs_section>

Maybe I am doing somethig the wrong way, but at least some nice error
would be fine.

Petr Ledvina
address@hidden




reply via email to

[Prev in Thread] Current Thread [Next in Thread]