2012-12-24 21:28:37 +01:00
|
|
|
/*
|
|
|
|
* This linker script is used to link rmodules (relocatable modules). It
|
|
|
|
* links at zero so that relocation fixups are easy when placing the binaries
|
|
|
|
* anywhere in the address space.
|
|
|
|
*
|
|
|
|
* NOTE: The program's loadable sections (text, module_params, and data) are
|
2014-03-10 22:13:58 +01:00
|
|
|
* packed into the flat blob. The rmodule loader assumes the entire program
|
|
|
|
* resides in one contiguous address space. Therefore, alignment for a given
|
|
|
|
* section (if required) needs to be done at the end of the preceeding section.
|
|
|
|
* e.g. if the data section should be aligned to an 8 byte address the text
|
|
|
|
* section should have ALIGN(8) at the end of its section. Otherwise there
|
|
|
|
* won't be a consistent mapping between the flat blob and the loaded program.
|
2012-12-24 21:28:37 +01:00
|
|
|
*/
|
|
|
|
|
|
|
|
BASE_ADDRESS = 0x00000;
|
|
|
|
|
2015-03-10 17:45:25 +01:00
|
|
|
ENTRY(__rmodule_entry);
|
|
|
|
|
2012-12-24 21:28:37 +01:00
|
|
|
SECTIONS
|
|
|
|
{
|
|
|
|
. = BASE_ADDRESS;
|
|
|
|
|
2014-03-10 22:13:58 +01:00
|
|
|
.payload : {
|
2012-12-24 21:28:37 +01:00
|
|
|
/* C code of the module. */
|
2014-03-10 22:13:58 +01:00
|
|
|
_ram_seg = .;
|
2013-03-23 01:55:35 +01:00
|
|
|
*(.textfirst);
|
2012-12-24 21:28:37 +01:00
|
|
|
*(.text);
|
|
|
|
*(.text.*);
|
|
|
|
/* C read-only data. */
|
|
|
|
. = ALIGN(16);
|
2013-02-06 22:47:31 +01:00
|
|
|
|
2013-03-23 01:55:35 +01:00
|
|
|
__CTOR_LIST__ = .;
|
|
|
|
*(.ctors);
|
|
|
|
LONG(0);
|
2014-08-27 00:01:41 +02:00
|
|
|
LONG(0);
|
2013-03-23 01:55:35 +01:00
|
|
|
__CTOR_END__ = .;
|
|
|
|
|
2013-02-06 22:47:31 +01:00
|
|
|
/* The driver sections are to allow linking coreboot's
|
|
|
|
* ramstage with the rmodule linker. Any changes made in
|
2014-04-22 19:41:05 +02:00
|
|
|
* ramstage.ld should be made here as well. */
|
2014-08-27 00:01:41 +02:00
|
|
|
. = ALIGN(8);
|
2013-02-06 22:47:31 +01:00
|
|
|
pci_drivers = . ;
|
2015-03-10 17:45:25 +01:00
|
|
|
KEEP(*(.rodata.pci_driver));
|
2013-02-06 22:47:31 +01:00
|
|
|
epci_drivers = . ;
|
2014-08-27 00:01:41 +02:00
|
|
|
. = ALIGN(8);
|
2013-02-06 22:47:31 +01:00
|
|
|
cpu_drivers = . ;
|
2015-03-10 17:45:25 +01:00
|
|
|
KEEP(*(.rodata.cpu_driver));
|
2013-02-06 22:47:31 +01:00
|
|
|
ecpu_drivers = . ;
|
2014-08-27 00:01:41 +02:00
|
|
|
. = ALIGN(8);
|
2013-04-24 23:12:52 +02:00
|
|
|
_bs_init_begin = .;
|
2015-03-10 17:45:25 +01:00
|
|
|
KEEP(*(.bs_init));
|
2015-03-16 23:30:09 +01:00
|
|
|
LONG(0);
|
|
|
|
LONG(0);
|
2013-04-24 23:12:52 +02:00
|
|
|
_bs_init_end = .;
|
|
|
|
|
2014-08-27 00:01:41 +02:00
|
|
|
. = ALIGN(8);
|
2013-02-06 22:47:31 +01:00
|
|
|
|
2012-12-24 21:28:37 +01:00
|
|
|
*(.rodata);
|
|
|
|
*(.rodata.*);
|
2014-08-27 00:01:41 +02:00
|
|
|
. = ALIGN(8);
|
2012-12-24 21:28:37 +01:00
|
|
|
|
|
|
|
/* The parameters section can be used to pass parameters
|
|
|
|
* to a module, however there has to be an prior agreement
|
|
|
|
* on how to interpret the parameters. */
|
|
|
|
_module_params_begin = .;
|
2015-03-10 17:45:25 +01:00
|
|
|
KEEP(*(.module_parameters));
|
2012-12-24 21:28:37 +01:00
|
|
|
_module_params_end = .;
|
2013-04-29 20:53:41 +02:00
|
|
|
. = ALIGN(8);
|
2012-12-24 21:28:37 +01:00
|
|
|
|
2013-04-29 20:53:41 +02:00
|
|
|
/* Data section. */
|
2012-12-24 21:28:37 +01:00
|
|
|
_sdata = .;
|
|
|
|
*(.data);
|
2014-03-25 20:53:28 +01:00
|
|
|
*(.data.*);
|
2014-08-27 00:01:41 +02:00
|
|
|
. = ALIGN(8);
|
2012-12-24 21:28:37 +01:00
|
|
|
_edata = .;
|
2013-04-29 20:53:41 +02:00
|
|
|
|
|
|
|
. = ALIGN(8);
|
2012-12-24 21:28:37 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
.bss (NOLOAD) : {
|
2013-02-06 22:47:31 +01:00
|
|
|
/* C uninitialized data of the module. */
|
|
|
|
_bss = .;
|
2012-12-24 21:28:37 +01:00
|
|
|
*(.bss);
|
2014-03-25 20:53:28 +01:00
|
|
|
*(.bss.*)
|
|
|
|
*(.sbss)
|
|
|
|
*(.sbss.*)
|
2012-12-24 21:28:37 +01:00
|
|
|
*(COMMON);
|
|
|
|
. = ALIGN(8);
|
2013-02-06 22:47:31 +01:00
|
|
|
_ebss = .;
|
2012-12-24 21:28:37 +01:00
|
|
|
|
|
|
|
/*
|
|
|
|
* Place the heap after BSS. The heap size is passed in by
|
|
|
|
* by way of ld --defsym=__heap_size=<>
|
|
|
|
*/
|
|
|
|
_heap = .;
|
|
|
|
. = . + __heap_size;
|
|
|
|
_eheap = .;
|
2014-03-10 22:13:58 +01:00
|
|
|
_eram_seg = .;
|
2012-12-24 21:28:37 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
/DISCARD/ : {
|
2014-03-10 22:13:58 +01:00
|
|
|
/* Drop unnecessary sections. */
|
2012-12-24 21:28:37 +01:00
|
|
|
*(.eh_frame);
|
2014-11-12 01:52:56 +01:00
|
|
|
*(.note);
|
|
|
|
*(.note.*);
|
2012-12-24 21:28:37 +01:00
|
|
|
}
|
|
|
|
}
|