This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: fix PR15222, excessive LMA alignment
- From: Sebastian Huber <sebastian dot huber at embedded-brains dot de>
- To: binutils at sourceware dot org
- Date: Fri, 17 May 2013 15:26:08 +0200
- Subject: Re: fix PR15222, excessive LMA alignment
- References: <20130305025239 dot GG562 at bubble dot grove dot modra dot org>
This change can break linker command files that worked well before this change.
Example:
.data : {
bsp_section_data_begin = .;
*(SORT(.bsp_data*))
*(.data .data.* .gnu.linkonce.d.*)
SORT(CONSTRUCTORS)
} > REGION_DATA AT > REGION_DATA_LOAD
.data1 : {
*(.data1)
} > REGION_DATA AT > REGION_DATA_LOAD
.sdata : {
PROVIDE (_SDA_BASE_ = 32768);
*(.sdata .sdata.* .gnu.linkonce.s.*)
bsp_section_data_end = .;
} > REGION_DATA AT > REGION_DATA_LOAD
bsp_section_data_size = bsp_section_data_end - bsp_section_data_begin;
bsp_section_data_load_begin = LOADADDR (.data);
bsp_section_data_load_end = bsp_section_data_load_begin + bsp_section_data_size;
Assume that the .data, .data1 and .sdata have different alignment requirements
and that regions REGION_DATA and REGION_DATA_LOAD are different. The load area
of the three sections is glued together with this change, but the runtime area
has gaps between the sections due to the different alignment requirements.
Now a memcpy(bsp_section_data_begin, bsp_section_data_load_begin,
bsp_section_data_size) no longer works.
How do we best address this problem?
1. Revert the change.
2. Select the behaviour depending on a command line or linker script option.
3. Require to fix the existing linker command files.
--
Sebastian Huber, embedded brains GmbH
Address : Dornierstr. 4, D-82178 Puchheim, Germany
Phone : +49 89 189 47 41-16
Fax : +49 89 189 47 41-09
E-Mail : sebastian.huber@embedded-brains.de
PGP : Public key available on request.
Diese Nachricht ist keine geschäftliche Mitteilung im Sinne des EHUG.