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]

Re: fix PR15222, excessive LMA alignment


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.


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