1# Copyright (c) 2024 Nordic Semiconductor
2#
3# SPDX-License-Identifier: Apache-2.0
4
5# Base properties.
6# Basic linker properties which should always be applied for a Zephyr build.
7set_property(TARGET linker PROPERTY base)
8
9# Base properties when C++ support is enabled.
10# Basic linker properties which should always be applied for a Zephyr build
11# using C++.
12set_property(TARGET linker PROPERTY cpp_base)
13
14# Base properties when building Zephyr for an embedded target (baremetal).
15set_property(TARGET linker PROPERTY baremetal)
16
17# Property for controlling linker reporting / handling when placing orphaned sections.
18set_property(TARGET linker PROPERTY orphan_warning)
19set_property(TARGET linker PROPERTY orphan_error)
20
21# coverage is a property holding the linker flag required for coverage support on the toolchain.
22# For example, on ld/gcc this would be: -lgcov
23# Set the property for the corresponding flags of the given toolchain.
24set_property(TARGET linker PROPERTY coverage)
25
26# Linker flag for printing of memusage.
27# Set this flag if the linker supports reporting of memusage as part of link,
28# such as ls --print-memory-usage flag.
29# If memory reporting is a post build command, please use
30# cmake/bintools/bintools.cmake instead.
31check_set_linker_property(TARGET linker PROPERTY memusage)
32
33# Extra warnings options for twister run
34set_property(TARGET linker PROPERTY warnings_as_errors)
35
36# Linker flag for disabling position independent binaries,
37# such as, "-no-pie" for LD, and "--no-pie" for LLD.
38set_property(TARGET linker PROPERTY no_position_independent)
39
40# Linker flag for doing partial linking
41# such as, "-r" or "--relocatable" for LD and LLD.
42set_property(TARGET linker PROPERTY partial_linking)
43
44# Linker flag for section sorting by alignment
45set_property(TARGET linker PROPERTY sort_alignment)
46
47# Linker flag for disabling relaxation of address optimization for jump calls.
48set_property(TARGET linker PROPERTY no_relax)
49
50# Linker flag for enabling relaxation of address optimization for jump calls.
51set_property(TARGET linker PROPERTY relax)
52
53# Linker flag for defining specs. Defined only by gcc, when gcc is used as
54# front-end for ld.
55set_compiler_property(PROPERTY specs)
56