| #
f3434bd3 |
| 28-Apr-2025 |
Jens Wiklander <jens.wiklander@linaro.org> |
core: arm: remove $(libgcccore) usage
Remove all remaining $(libgcccore) usage now that lib/libutils/compiler-rt provides the needed bits.
Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
core: arm: remove $(libgcccore) usage
Remove all remaining $(libgcccore) usage now that lib/libutils/compiler-rt provides the needed bits.
Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org> Reviewed-by: Jerome Forissier <jerome.forissier@linaro.org>
show more ...
|
| #
0ae5ef34 |
| 03-Apr-2025 |
Thomas Bourgoin <thomas.bourgoin@foss.st.com> |
tree wide: fix header files dependencies in linker files
When linking with a generated linker script like kern.ld.S, dependencies with header file are not regenerated. Same issue as commit acdc32afe
tree wide: fix header files dependencies in linker files
When linking with a generated linker script like kern.ld.S, dependencies with header file are not regenerated. Same issue as commit acdc32afe18f ("mk/compile.mk: fix header dependency in .d file")
Add option -MP used to fix error generated when removing header files.
Signed-off-by: Thomas Bourgoin <thomas.bourgoin@foss.st.com> Reviewed-by: Jerome Forissier <jerome.forissier@linaro.org> Acked-by: Jens Wiklander <jens.wiklander@linaro.org>
show more ...
|
| #
45fecab0 |
| 06-Mar-2025 |
Jens Wiklander <jens.wiklander@linaro.org> |
Deprecate libgcc for OP-TEE core and ldelf
By default turn of linking with ligcc for OP-TEE core and ldelf. This allows building CFG_CORE_BTI=y and CFG_TA_BTI=n using a AArch64 cross toolchain witho
Deprecate libgcc for OP-TEE core and ldelf
By default turn of linking with ligcc for OP-TEE core and ldelf. This allows building CFG_CORE_BTI=y and CFG_TA_BTI=n using a AArch64 cross toolchain without BTI enabled in libgcc.
Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org> Reviewed-by: Joakim Bech <joakim.bech@linaro.org> Reviewed-by: Jerome Forissier <jerome.forissier@linaro.org>
show more ...
|
| #
2bb485c3 |
| 14-Aug-2024 |
Jerome Forissier <jerome.forissier@linaro.org> |
kernel/link.mk: fix missing build number in version string on first build
Fix an issue with the build number in the version string. While at it, factor out the duplicated code into mk/macros.mk.
Be
kernel/link.mk: fix missing build number in version string on first build
Fix an issue with the build number in the version string. While at it, factor out the duplicated code into mk/macros.mk.
Before:
$ rm -rf out/ $ make out/arm-plat-vexpress/core/version.o UPD out/arm-plat-vexpress/core/.buildcount GEN out/arm-plat-vexpress/core/version.o cat: out/arm-plat-vexpress/core/.buildcount: No such file or directory
In addition to the error message, note the missing build number after the hash sign:
$ strings out/arm-plat-vexpress/core/version.o | grep UTC 4.3.0-48-g9c97e7d52 (gcc version 11.4.0 (Ubuntu 11.4.0-1ubuntu1~22.04)) # Wed Aug 14 16:17:07 UTC 2024 arm
After:
$ rm -rf out/ $ make out/arm-plat-vexpress/core/version.o UPD out/arm-plat-vexpress/core/.buildcount GEN out/arm-plat-vexpress/core/version.o $ strings out/arm-plat-vexpress/core/version.o | grep UTC 4.3.0-48-g9c97e7d52-dev (gcc version 11.4.0 (Ubuntu 11.4.0-1ubuntu1~22.04)) #1 Wed Aug 14 16:17:24 UTC 2024 arm
Signed-off-by: Jerome Forissier <jerome.forissier@linaro.org> Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org>
show more ...
|
| #
ab1707d1 |
| 01-Aug-2024 |
Mikko Rapeli <mikko.rapeli@linaro.org> |
link.mk: generate version.o in link-out-dir
When source code is piped to compiler, then the current working directory is left into debug data. If the working directory is not the output directory, t
link.mk: generate version.o in link-out-dir
When source code is piped to compiler, then the current working directory is left into debug data. If the working directory is not the output directory, then mappings which strip absolute output directory paths don't work.
Removes absolute build time paths from version.o debug info.
Reviewed-by: Jerome Forissier <jerome.forissier@linaro.org> Signed-off-by: Mikko Rapeli <mikko.rapeli@linaro.org>
show more ...
|
| #
865e6147 |
| 01-Aug-2024 |
Mikko Rapeli <mikko.rapeli@linaro.org> |
link.mk: use CFLAGS with version.o
Should be used by all compilations.
Reviewed-by: Jerome Forissier <jerome.forissier@linaro.org> Signed-off-by: Mikko Rapeli <mikko.rapeli@linaro.org>
|
| #
0d928692 |
| 11-Apr-2023 |
Jens Wiklander <jens.wiklander@linaro.org> |
core: support physically relocatable OP-TEE binary
With CFG_CORE_PHYS_RELOCATABLE=y enable support in OP-TEE to relocate itself to allow it to run from physical address that differs from the link ad
core: support physically relocatable OP-TEE binary
With CFG_CORE_PHYS_RELOCATABLE=y enable support in OP-TEE to relocate itself to allow it to run from physical address that differs from the link address.
This feature is currently only supported with CFG_CORE_SEL2_SPMC=y since the TEE core has to know the range of available memory. With SPMC at EL2 this is accomplished via get_sec_mem_from_manifest(). An SPMC at S-EL2 may need to load OP-TEE at a different address depending on configuration.
Acked-by: Etienne Carriere <etienne.carriere@linaro.org> Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
show more ...
|
| #
376cb124 |
| 16-Feb-2023 |
Jens Wiklander <jens.wiklander@linaro.org> |
core: arm: link.mk: produce tee-raw.bin by default
Adds tee-raw.bin as a dependency of all. This produces a tee-raw.bin for all platforms when building. tee-raw.bin is more useful than for instance
core: arm: link.mk: produce tee-raw.bin by default
Adds tee-raw.bin as a dependency of all. This produces a tee-raw.bin for all platforms when building. tee-raw.bin is more useful than for instance tee-pager_v2.bin which often is used when a raw binary is needed. Platforms with a link.mk only to produce tee-raw.bin have their link.mk removed since the generic version suffices now.
Acked-by: Clement Faure <clement.faure@nxp.com> Acked-by: Jerome Forissier <jerome.forissier@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org> Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
show more ...
|
| #
2f4d97e7 |
| 23-Aug-2022 |
Jerome Forissier <jerome.forissier@linaro.org> |
core, ldelf: link: add --no-warn-execstack
When building for arm32 with GNU binutils 2.39, the linker outputs warnings when generating some TEE core binaries (all_obj.o, init.o, unpaged.o and tee.el
core, ldelf: link: add --no-warn-execstack
When building for arm32 with GNU binutils 2.39, the linker outputs warnings when generating some TEE core binaries (all_obj.o, init.o, unpaged.o and tee.elf) as well as ldelf.elf:
arm-poky-linux-gnueabi-ld.bfd: warning: atomic_a32.o: missing .note.GNU-stack section implies executable stack arm-poky-linux-gnueabi-ld.bfd: NOTE: This behaviour is deprecated and will be removed in a future version of the linker
The permissions used when mapping the TEE core stacks do not depend on any metadata found in the ELF file. Similarly when the TEE core loads ldelf it already creates a non-executable stack regardless of ELF information. Therefore we can safely ignore the warnings. This is done by adding the '--no-warn-execstack' option.
Signed-off-by: Jerome Forissier <jerome.forissier@linaro.org> Acked-by: Jens Wiklander <jens.wiklander@linaro.org>
show more ...
|
| #
0b8a917f |
| 05-Aug-2022 |
Jerome Forissier <jerome.forissier@linaro.org> |
core: link: add --no-warn-rwx-segments
binutils ld.bfd generates one RWX LOAD segment by merging several sections with mixed R/W/X attributes (.text, .rodata, .data). After version 2.38 it also warn
core: link: add --no-warn-rwx-segments
binutils ld.bfd generates one RWX LOAD segment by merging several sections with mixed R/W/X attributes (.text, .rodata, .data). After version 2.38 it also warns by default when that happens [1], which breaks the build due to --fatal-warnings. The RWX segment is not a problem for the TEE core, since that information is not used to set memory permissions. Therefore, silence the warning.
Link: [1] https://sourceware.org/git/?p=binutils-gdb.git;a=commit;h=ba951afb99912da01a6e8434126b8fac7aa75107 Link: https://sourceware.org/bugzilla/show_bug.cgi?id=29448 Reported-by: Dominique Martinet <dominique.martinet@atmark-techno.com> Signed-off-by: Jerome Forissier <jerome.forissier@linaro.org> Acked-by: Jens Wiklander <jens.wiklander@linaro.org>
show more ...
|
| #
77b091e1 |
| 24-Jun-2022 |
Jerome Forissier <jerome.forissier@linaro.org> |
core: make sure build date is always in English
Setting LANG=C before invoking the date command doesn't always result in the "C" (English) locale being selected. The correct way is to set LC_ALL. As
core: make sure build date is always in English
Setting LANG=C before invoking the date command doesn't always result in the "C" (English) locale being selected. The correct way is to set LC_ALL. As explained in the locale(7) man page:
If the second argument to setlocale(3) is an empty string, "", for the default locale, it is determined using the following steps:
1. If there is a non-null environment variable LC_ALL, the value of LC_ALL is used.
2. If an environment variable with the same name as one of the categories above exists and is non-null, its value is used for that category.
3. If there is a non-null environment variable LANG, the value of LANG is used.
Fixes: 3e2b963515c1 ("core: use C locale when generating the build date") Signed-off-by: Jerome Forissier <jerome.forissier@linaro.org> Reviewed-by: Igor Opaniuk <igor.opaniuk@foundries.io> Tested-by: Igor Opaniuk <igor.opaniuk@foundries.io> Acked-by: Jens Wiklander <jens.wiklander@linaro.org>
show more ...
|
| #
f1fee325 |
| 04-Jan-2022 |
Jerome Forissier <jerome@forissier.org> |
core: arm64: aslr: pass '-z text' linker option
On arm64, all the relocations in read-only segments have been fixed in previous commits, pass the '-z text' linker option to detect if some unexpected
core: arm64: aslr: pass '-z text' linker option
On arm64, all the relocations in read-only segments have been fixed in previous commits, pass the '-z text' linker option to detect if some unexpected relocations are introduced by mistake.
Signed-off-by: Jerome Forissier <jerome@forissier.org> Acked-by: Sumit Garg <sumit.garg@linaro.org> Acked-by: Jens Wiklander <jens.wiklander@linaro.org>
show more ...
|
| #
61487fe8 |
| 14-Jan-2022 |
Etienne Carriere <etienne.carriere@linaro.org> |
core: link: platform can define pager dummy resources
Allows platform to define paged and init dummy resources to allows platform specific resources to be linked in unpaged memory sections without p
core: link: platform can define pager dummy resources
Allows platform to define paged and init dummy resources to allows platform specific resources to be linked in unpaged memory sections without propagating their unpaged constraint to the resources they depend on.
Platform should implement source files link_dummies_paged.c and/or link_dummies_init.c from their platform directory when needed.
Acked-by: Jerome Forissier <jerome@forissier.org> Signed-off-by: Etienne Carriere <etienne.carriere@linaro.org>
show more ...
|
| #
48685b6c |
| 16-Dec-2021 |
Jerome Forissier <jerome@forissier.org> |
arm64: bti: fail link phase if some objects do not support BTI
Adds the proper linker options (-z force-bti --fatal-warnings) to fail the link if some object files lack the BTI feature bit when BTI
arm64: bti: fail link phase if some objects do not support BTI
Adds the proper linker options (-z force-bti --fatal-warnings) to fail the link if some object files lack the BTI feature bit when BTI is requested (CFG_CORE_BTI=Y, CFG_TA_BTI=y). The options are added for tee.elf, ldelf.elf, in-tree TAs, in-tree user space shared libraries (CFG_ULIBS_SHARED=y) as well as for external TAs and shared libraries built with the dev kit.
Signed-off-by: Jerome Forissier <jerome@forissier.org> Reviewed-by: Ruchika Gupta <ruchika.gupta@linaro.org>
show more ...
|
| #
7b701d1b |
| 09-Apr-2021 |
Volodymyr Babchuk <volodymyr_babchuk@epam.com> |
core/link.mk, plat-rcar: introduce SRECFLAGS variable
.srec files are used to flash OPTEE on Rcar Gen3 using serial mode. Serial mode downloader in Rcar does not recognize S2 records in .srec files
core/link.mk, plat-rcar: introduce SRECFLAGS variable
.srec files are used to flash OPTEE on Rcar Gen3 using serial mode. Serial mode downloader in Rcar does not recognize S2 records in .srec files that objcopy generates by default. It allows only S3 records. Also, it requires correct load address present in .srec files.
So, we need to provide additional flags to objcopy during tee.srec file generation. This change introduces makefile variable SRECFLAGS that can be used exactly for this task. Also it provides the correct flags for rcar platform.
Note: at the begging tee.srec file was generated directly from tee.elf and had correct load addresses. As the load address is wider than 24 bits, objcopy automatically used S3 records. But, later tee-raw.bin were introduced and I changed source for tee.srec, so now it is generated from tee-raw.bin. As tee-raw.bin have no load address information this leads to incorrect tee.srec file.
Strictly speaking, only --adjust-vma option is required. As current load address is wider than 24 bits, objcopy will switch to S3 records automatically. But I prefer to have --srec-forceS3 option anyways: for that unlikely chance that CFG_TZDRAM_START would be changed to something much lower.
Fixes: e66c2639b6b ("plat: rcar: generate .srec file using gen_tee_bin")
Reviewed-by: Jerome Forissier <jerome@forissier.org> Signed-off-by: Volodymyr Babchuk <volodymyr_babchuk@epam.com>
show more ...
|
| #
5ae0290f |
| 10-Dec-2020 |
Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com> |
core: kernel: link.mk: Move rules to generate tee-raw.bin and tee.srec from rcar platform
Move the rules to generate tee-raw.bin and tee.srec from rcar platform to core/arch/arm/kernel/link.mk so th
core: kernel: link.mk: Move rules to generate tee-raw.bin and tee.srec from rcar platform
Move the rules to generate tee-raw.bin and tee.srec from rcar platform to core/arch/arm/kernel/link.mk so that similar platforms can re-use it.
Signed-off-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com> Acked-by: Jens Wiklander <jens.wiklander@linaro.org> Reviewed-by: Jerome Forissier <jerome@forissier.org>
show more ...
|
| #
5cc9ca58 |
| 04-Dec-2020 |
Marouene Boubakri <marouene.boubakri@nxp.com> |
core: kernel: link.mk: make path to kernel linker script generic
The path to kernel script is hard-coded. Despite it is in a arch specific folder, it should use defined variables. This is helpful in
core: kernel: link.mk: make path to kernel linker script generic
The path to kernel script is hard-coded. Despite it is in a arch specific folder, it should use defined variables. This is helpful in case of porting OP-TEE OS to a new architecture such we make maximum reuse of existing sources.
Signed-off-by: Marouene Boubakri <marouene.boubakri@nxp.com> Acked-by: Jerome Forissier <jerome@forissier.org>
show more ...
|
| #
60c2d1df |
| 24-Sep-2020 |
Jorge Ramirez-Ortiz <jorge@foundries.io> |
core: build: se050 driver
Core work to support building the platform independent se050 crypto driver.
Signed-off-by: Jorge Ramirez-Ortiz <jorge@foundries.io> Acked-by: Jerome Forissier <jerome@fori
core: build: se050 driver
Core work to support building the platform independent se050 crypto driver.
Signed-off-by: Jorge Ramirez-Ortiz <jorge@foundries.io> Acked-by: Jerome Forissier <jerome@forissier.org>
show more ...
|
| #
3e2b9635 |
| 29-Sep-2020 |
Jerome Forissier <jerome@forissier.org> |
core: use C locale when generating the build date
The build date included in the version string depends on the current locale (language), which is not very good. Force LANG=C so that english abbrevi
core: use C locale when generating the build date
The build date included in the version string depends on the current locale (language), which is not very good. Force LANG=C so that english abbreviations are used for the day and month.
Signed-off-by: Jerome Forissier <jerome@forissier.org> Reviewed-by: Rouven Czerwinski <r.czerwinski@pengutronix.de> Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org> Acked-by: Etienne Carriere <etienne.carriere@linaro.org>
show more ...
|
| #
b4faf480 |
| 22-Jul-2020 |
Dick Olsson <hi@senzilla.io> |
mk: core: ta: Configurable Python interpreter
Build systems that manage multiple different python interpreters need explicit control over which version of the interpreter to use. This patch enables
mk: core: ta: Configurable Python interpreter
Build systems that manage multiple different python interpreters need explicit control over which version of the interpreter to use. This patch enables one to override the default interpreter with the path to a specific one.
Signed-off-by: Dick Olsson <hi@senzilla.io> Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org> Reviewed-by: Jerome Forissier <jerome@forissier.org>
show more ...
|
| #
7fdadfdb |
| 19-May-2020 |
Jerome Forissier <jerome@forissier.org> |
core: aslr: suppress R_AARCH64_ABS64 and R_ARM_ABS32 relocations
The following errors were observed when building with GCC 6.2.1:
- 64 bits: GEN out/arm/core/tee.bin Unexpected relocation t
core: aslr: suppress R_AARCH64_ABS64 and R_ARM_ABS32 relocations
The following errors were observed when building with GCC 6.2.1:
- 64 bits: GEN out/arm/core/tee.bin Unexpected relocation type 0x101
- 32 bits: GEN out/arm/core/tee.bin Unexpected relocation type 0x2
Relocation type 0x101 is R_AARCH64_ABS64 and 0x2 is R_ARM_ABS32. The errors are output by scripts/gen_tee_bin.py which expects only relative relocations (the ones that are necessary for ASLR).
This patch adds the -Bsymbolic linker option to avoid these relocations. More information can be found in Linux commit [1].
Link: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=08cc55b2afd97a654f71b3bebf8bb0ec89fdc498 Signed-off-by: Jerome Forissier <jerome@forissier.org> Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org> Acked-by: Etienne Carriere <etienne.carriere@linaro.org>
show more ...
|
| #
b77aa8a0 |
| 24-Apr-2020 |
Jerome Forissier <jerome@forissier.org> |
core: clang: add --apply-dynamic-relocs linker flag
Core ASLR relies on the executable being ready to run from its preferred load address, because some symbols are used before the MMU is enabled and
core: clang: add --apply-dynamic-relocs linker flag
Core ASLR relies on the executable being ready to run from its preferred load address, because some symbols are used before the MMU is enabled and relocations are applied. Clang (ld.lld) on Aarch64 needs a special flag for this: --apply-dynamic-relocs. Without the flag the R_AARCH64_RELATIVE places are initially filled with zeros.
Signed-off-by: Jerome Forissier <jerome@forissier.org> Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org> Acked-by: Etienne Carriere <etienne.carriere@linaro.org>
show more ...
|
| #
66f79941 |
| 26-Feb-2020 |
Jens Wiklander <jens.wiklander@linaro.org> |
core: exclude get_aslr_seed() from unpaged part
Excludes get_aslr_seed() from unpaged part and makes sure it's still in the init part.
Reviewed-by: Jerome Forissier <jerome@forissier.org> Signed-of
core: exclude get_aslr_seed() from unpaged part
Excludes get_aslr_seed() from unpaged part and makes sure it's still in the init part.
Reviewed-by: Jerome Forissier <jerome@forissier.org> Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
show more ...
|
| #
5502aad4 |
| 25-Nov-2019 |
Jens Wiklander <jens.wiklander@linaro.org> |
core: link.mk: Make sure to link without relro
Passes -z norelro to linker to make sure that the relro option isn't enabled. With relro enabled all relro sections has to be contiguous with each oth
core: link.mk: Make sure to link without relro
Passes -z norelro to linker to make sure that the relro option isn't enabled. With relro enabled all relro sections has to be contiguous with each other. This would prevent us from removing .dynamic from the binary created with scripts/gen_tee_bin.py. Regardless of the relro option OP-TEE itself uses the equivalent of relro when mapping its memory.
Reviewed-by: Jerome Forissier <jerome@forissier.org> Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
show more ...
|
| #
c2c16e87 |
| 09-Dec-2019 |
Andrew F. Davis <afd@ti.com> |
core: link.mk: Un-deprecate tee.bin v1 image generation
The v1 OP-TEE image "tee.bin" is used by a couple platforms as the only supported image version, until these platforms can migrate continue to
core: link.mk: Un-deprecate tee.bin v1 image generation
The v1 OP-TEE image "tee.bin" is used by a couple platforms as the only supported image version, until these platforms can migrate continue to build this image and do not mark it a deprecated. The tee-pager.bin and tee-pageable.bin are not used by these platforms and are properly deprecated by the v2 versions, leave these images deprecated.
Signed-off-by: Andrew F. Davis <afd@ti.com> Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org>
show more ...
|