blob: 4595481ff2e389ef8245d1539ef914f0c45d0a24 [file] [log] [blame]
Martin Rothfb8876d2022-08-07 15:12:12 -06001/* SPDX-License-Identifier: GPL-2.0-only */
2
Aaron Durbinad935522012-12-24 14:28:37 -06003/*
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 Durbin3eb8eb72014-03-10 16:13:58 -05009 * 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 HAOUAS3d450002018-08-09 18:55:58 +020011 * section (if required) needs to be done at the end of the preceding section.
Aaron Durbin3eb8eb72014-03-10 16:13:58 -050012 * 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 Durbinad935522012-12-24 14:28:37 -060015 */
16
Aaron Durbindde76292015-09-05 12:59:26 -050017#include <memlayout.h>
18#include <arch/header.ld>
Aaron Durbinf69a99d2015-03-10 11:45:25 -050019
Aaron Durbinad935522012-12-24 14:28:37 -060020SECTIONS
21{
Aaron Durbindde76292015-09-05 12:59:26 -050022 SET_COUNTER(rmodule, 0x00000000)
Aaron Durbinad935522012-12-24 14:28:37 -060023
Aaron Durbindde76292015-09-05 12:59:26 -050024 /* program.ld is directly included because there's no one particular
25 * class that rmodule is used on. */
26 #include <lib/program.ld>
Aaron Durbinad935522012-12-24 14:28:37 -060027}