This is the mail archive of the
mailing list for the binutils project.
Re: What causes the 'BFD: Dwart Error:' ?
- From: Jim Wilson <wilson at tuliptree dot org>
- To: PRC <panruochen at gmail dot com>
- Cc: binutils <binutils at sourceware dot org>
- Date: Tue, 11 Mar 2008 22:14:16 -0700
- Subject: Re: What causes the 'BFD: Dwart Error:' ?
- References: <email@example.com>
If I comment out definition of `mydata1' in 1.c, the objdump error disappear as well.
How does this error occur?
Using __attribute__ ((section)) creates a section with data. Your
linker script is putting this section data into the bss section.
However, a bss section never contains data. Since everything will be
forced to zero at run time, there is no point in having any actual data
in the bss section. Note that the file offset of the following section
is the same as the bss section, since the bss section contains no actual
data in the object file.
I think bfd is getting confused, trying to append data to the should-
be-empty bss section, and accidentally overwriting the debugging info.
This data is all zeros. Leading zeros in the debug info will be
ignored, until it gets to non-zero info, which will then fail to parse
giving various curious error messages.