Skip to content

Commit

Permalink
elfloader/linker: Unify linker.lds in one file
Browse files Browse the repository at this point in the history
This allows to use the same file for both Arm and RISC-V.
Furthermore, this new file is more portable and works with
both LLVM/lld and GNU's ld, unlike the removed Arm's one
which contains directives and sections that lld does not
handle (e.g., .interp, INSERT BEFORE .hash).

Signed-off-by: Hesham Almatary <[email protected]>
  • Loading branch information
heshamelmatary committed Jan 15, 2024
1 parent db8d245 commit 843b0c9
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 53 deletions.
2 changes: 1 addition & 1 deletion elfloader-tool/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ config_option(
add_config_library(elfloader "${configure_string}")

add_compile_options(-D_XOPEN_SOURCE=700 -ffreestanding -Wall -Werror -W -Wextra)
set(linkerScript "${CMAKE_CURRENT_LIST_DIR}/src/arch-${KernelArch}/linker.lds")
set(linkerScript "${CMAKE_CURRENT_LIST_DIR}/src/linker.lds")
if(KernelArchRiscV)
add_compile_options(-mcmodel=medany)
endif()
Expand Down
51 changes: 0 additions & 51 deletions elfloader-tool/src/arch-arm/linker.lds

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,14 @@ SECTIONS
*(.data.*)
}
. = ALIGN(16);
.bss :
.bss (NOLOAD) :
{
#ifdef CONFIG_ARCH_ARM
. = ALIGN(0x1000);
core_stack_alloc = .;
. += CONFIG_MAX_NUM_NODES * (1 << 12);
core_stack_alloc_end = .;
#endif
_bss = .;
*(.sbss*)
*(.bss)
Expand Down

0 comments on commit 843b0c9

Please sign in to comment.