This is the mail archive of the binutils@sourceware.org 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]
Other format: [Raw text]

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


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