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