[PATCH][gold] Fix the assignment of LMA for subsequent sections which do not have their own explicit address set.
Igor Kudrin
ikudrin@accesssoftek.com
Tue Oct 18 14:24:00 GMT 2016
Hi,
This patch handles the case when a section without an explicitly set
VMA follows a section which has different LMA and VMA. In this case,
the subsequent section is expected to have the same difference
between its VMA and LMA as the previous section has. See
https://sourceware.org/binutils/docs/ld/Output-Section-LMA.html#Output-Section-LMA.
Best regards,
Igor Kudrin
---
gold/ChangeLog
* output.cc
(Output_segment::set_section_addresses): Handle the physical
address (paddr) separately from the virtual address (addr).
Adjust call to Output_segment::set_section_list_addresses.
(Output_segment::set_section_list_addresses): Add paddr
argument. Use the load address and the current physical
address to calculate offsets of sections.
* output.h (Output_segment::set_section_list_addresses):
Add paddr argument.
* script-sections.cc
(Sections_element_dot_assignment::set_section_addresses):
Calculate load_address using the change of the dot_value.
(Output_section_definition::set_section_addresses): Handle
the case when neighter a VMA nor an LMA region is set for
the section.
* testsuite/Makefile.am (pr20280): New test.
* testsuite/Makefile.in: Regenerate
* testsuite/pr20280.s: New test source file.
* testsuite/pr20280.sh: New test script.
* testsuite/pr20280.t: New test linker script.
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: gold-pr20280-LMA.patch.txt
URL: <https://sourceware.org/pipermail/binutils/attachments/20161018/e3d37687/attachment.txt>
More information about the Binutils
mailing list