This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
size_input_section calcs output_offset incorrectly for merged sections
- From: Michael Eager <eager at eagercon dot com>
- To: binutils at sourceware dot org
- Date: Sat, 05 Jan 2008 08:59:04 -0800
- Subject: size_input_section calcs output_offset incorrectly for merged sections
I'm seeing a problem in size_input_section() when it
processes a merged section. If the merged section is to
be included in the output, the output_offset value is
computed as:
i->output_offset = dot - output_section_statement->bfd_section->vma;
If the section has been eliminated and is marked as SEC_EXCLUDE,
the section's output_offset value is computed as:
i->output_offset = i->vma - output_section_statement->bfd_section->vma;
i->vma is zero, which results in output_offset being the inverse
of the output vma. Later, during relaxation, output_offset is
added to vma resulting in an incorrect symbol address of zero.
It seems to me that output_offset should be the same in both
cases. I've run a couple tests which work with this change.
Does this seem correct?
--
Michael Eager eager@eagercon.com
1960 Park Blvd., Palo Alto, CA 94306 650-325-8077