rmodule: put all code/data bits in one section
While debugging a crash it was discovered that ld was inserting address space for sections that were empty depending on section address boundaries. This led to the assumption breaking down that on-disk payload (code/data bits) was contiguous with the address space. When that assumption breaks down relocation updates change the wrong memory. Fix this by making the rmodule.ld linker script put all code/data bits into a payload section. Change-Id: Ib5df7941bbd64662090136e49d15a570a1c3e041 Signed-off-by: Aaron Durbin <adurbin@chromium.org> Reviewed-on: http://review.coreboot.org/3149 Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org> Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net> Tested-by: build bot (Jenkins)
This commit is contained in:
parent
ac4b00e230
commit
e1be5ae2f4
|
@ -35,7 +35,7 @@ SECTIONS
|
||||||
_module_link_start_addr = .;
|
_module_link_start_addr = .;
|
||||||
_payload_begin_offset = LOADADDR(.header) + SIZEOF(.header);
|
_payload_begin_offset = LOADADDR(.header) + SIZEOF(.header);
|
||||||
|
|
||||||
.text : AT (_payload_begin_offset) {
|
.payload : AT (_payload_begin_offset) {
|
||||||
/* C code of the module. */
|
/* C code of the module. */
|
||||||
*(.textfirst);
|
*(.textfirst);
|
||||||
*(.text);
|
*(.text);
|
||||||
|
@ -66,27 +66,26 @@ SECTIONS
|
||||||
*(.rodata);
|
*(.rodata);
|
||||||
*(.rodata.*);
|
*(.rodata.*);
|
||||||
. = ALIGN(4);
|
. = ALIGN(4);
|
||||||
}
|
|
||||||
|
|
||||||
.module_params : AT (LOADADDR(.text) + SIZEOF(.text)) {
|
|
||||||
/* The parameters section can be used to pass parameters
|
/* The parameters section can be used to pass parameters
|
||||||
* to a module, however there has to be an prior agreement
|
* to a module, however there has to be an prior agreement
|
||||||
* on how to interpret the parameters. */
|
* on how to interpret the parameters. */
|
||||||
_module_params_begin = .;
|
_module_params_begin = .;
|
||||||
*(.module_parameters);
|
*(.module_parameters);
|
||||||
_module_params_end = .;
|
_module_params_end = .;
|
||||||
. = ALIGN(4);
|
. = ALIGN(8);
|
||||||
}
|
|
||||||
|
|
||||||
.data : AT (LOADADDR(.module_params) + SIZEOF(.module_params)) {
|
/* Data section. */
|
||||||
_sdata = .;
|
_sdata = .;
|
||||||
*(.data);
|
*(.data);
|
||||||
. = ALIGN(4);
|
. = ALIGN(4);
|
||||||
_edata = .;
|
_edata = .;
|
||||||
|
|
||||||
|
. = ALIGN(8);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* _payload_end marks the end of the module's code and data. */
|
/* _payload_end marks the end of the module's code and data. */
|
||||||
_payload_end_offset = LOADADDR(.data) + SIZEOF(.data);
|
_payload_end_offset = LOADADDR(.payload) + SIZEOF(.payload);
|
||||||
|
|
||||||
.bss (NOLOAD) : {
|
.bss (NOLOAD) : {
|
||||||
/* C uninitialized data of the module. */
|
/* C uninitialized data of the module. */
|
||||||
|
|
Loading…
Reference in New Issue