Aaron Durbin | ad93552 | 2012-12-24 14:28:37 -0600 | [diff] [blame] | 1 | /* |
| 2 | * This linker script is used to link rmodules (relocatable modules). It |
| 3 | * links at zero so that relocation fixups are easy when placing the binaries |
| 4 | * anywhere in the address space. |
| 5 | * |
| 6 | * NOTE: The program's loadable sections (text, module_params, and data) are |
Aaron Durbin | 3eb8eb7 | 2014-03-10 16:13:58 -0500 | [diff] [blame] | 7 | * packed into the flat blob. The rmodule loader assumes the entire program |
| 8 | * resides in one contiguous address space. Therefore, alignment for a given |
| 9 | * section (if required) needs to be done at the end of the preceeding section. |
| 10 | * e.g. if the data section should be aligned to an 8 byte address the text |
| 11 | * section should have ALIGN(8) at the end of its section. Otherwise there |
| 12 | * won't be a consistent mapping between the flat blob and the loaded program. |
Aaron Durbin | ad93552 | 2012-12-24 14:28:37 -0600 | [diff] [blame] | 13 | */ |
| 14 | |
Aaron Durbin | dde7629 | 2015-09-05 12:59:26 -0500 | [diff] [blame] | 15 | #include <memlayout.h> |
| 16 | #include <arch/header.ld> |
Aaron Durbin | f69a99d | 2015-03-10 11:45:25 -0500 | [diff] [blame] | 17 | |
Aaron Durbin | ad93552 | 2012-12-24 14:28:37 -0600 | [diff] [blame] | 18 | SECTIONS |
| 19 | { |
Aaron Durbin | dde7629 | 2015-09-05 12:59:26 -0500 | [diff] [blame] | 20 | SET_COUNTER(rmodule, 0x00000000) |
Aaron Durbin | ad93552 | 2012-12-24 14:28:37 -0600 | [diff] [blame] | 21 | |
Aaron Durbin | dde7629 | 2015-09-05 12:59:26 -0500 | [diff] [blame] | 22 | /* program.ld is directly included because there's no one particular |
| 23 | * class that rmodule is used on. */ |
| 24 | #include <lib/program.ld> |
Aaron Durbin | ad93552 | 2012-12-24 14:28:37 -0600 | [diff] [blame] | 25 | } |