This is the mail archive of the
binutils@sourceware.org
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: 2008年3月11日 22:14:16 -0700
- Subject: Re: What causes the 'BFD: Dwart Error:' ?
- References: <200803111818543292430@gmail.com>
PRC wrote:
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.
Jim