History log of /optee_os/scripts/gen_tee_bin.py (Results 1 – 10 of 10)
Revision Date Author Comments
# cb6e5189 11-Apr-2022 Jens Wiklander <jens.wiklander@linaro.org>

scripts/gen_tee_bin.py: inlude .ctors in included sections

Includes the section .ctors in sections included in the pager binary.
This fixes a problem where the constructor function pointers are all

scripts/gen_tee_bin.py: inlude .ctors in included sections

Includes the section .ctors in sections included in the pager binary.
This fixes a problem where the constructor function pointers are all
zeroes. Constructors are normally not used by OP-TEE, but with
CFG_CORE_SANITIZE_KADDRESS=y it's used to initialize access to global
variables.

Acked-by: Jerome Forissier <jerome.forissier@linaro.org>
Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>

show more ...


# c0af48e6 03-Jan-2022 Jerome Forissier <jerome@forissier.org>

core: kern.ld.S: move .scattered_array* into .data.rel.ro

Moves the symbols tagged with .scattered_array* from the .rodata output
section into a new output section: .data.rel.ro, which is also writ

core: kern.ld.S: move .scattered_array* into .data.rel.ro

Moves the symbols tagged with .scattered_array* from the .rodata output
section into a new output section: .data.rel.ro, which is also writeable
(hence the suppression of __SECTION_FLAGS_RODATA in scattered_array.h)
but placed in tee.elf to be mapped read-only after relocations are
applied. The new section is created only when core ASLR is enabled,
otherwise no relocation can occur and we can keep the previous code.

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 ...


# 4b2d8945 23-Jan-2020 Volodymyr Babchuk <volodymyr_babchuk@epam.com>

gen_tee_bin: include .nex_data section

.nex_data section were missing in the resulting binary, which lead to
broken OP-TEE image that was unable to boot.

Signed-off-by: Volodymyr Babchuk <volodymyr

gen_tee_bin: include .nex_data section

.nex_data section were missing in the resulting binary, which lead to
broken OP-TEE image that was unable to boot.

Signed-off-by: Volodymyr Babchuk <volodymyr_babchuk@epam.com>
Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org>
[jf: fix spelling mistake in subject]
Signed-off-by: Jerome Forissier <jerome@forissier.org>

show more ...


# 82fa806b 22-Jan-2020 Volodymyr Babchuk <volodymyr_babchuk@epam.com>

gen_tee_bin: generate tee-raw.bin

Some platforms (like Rcar Gen3) still does not support OP-TEE images
wrapped into any type of container. In the past we were able to
generate raw binary straight fr

gen_tee_bin: generate tee-raw.bin

Some platforms (like Rcar Gen3) still does not support OP-TEE images
wrapped into any type of container. In the past we were able to
generate raw binary straight from the resulting elf file. But with
recent changes, OP-TEE expects some additional data past the __end, so
wee need to use gen_tee_bin.py to generate header-less OP-TEE binary.

This patch adds `--out_tee_raw_bin` option, which generates needed
file.

Signed-off-by: Volodymyr Babchuk <volodymyr_babchuk@epam.com>
Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org>

show more ...


# 55c1b947 10-Dec-2019 Jens Wiklander <jens.wiklander@linaro.org>

core: fix generation of tee.bin

Prior to this patch generation of tee.bin (CFG_WITH_PAGER=n) fails with:
GEN out/core/tee.bin
Cannot find symbol __init_end
core/arch/arm/kernel/link.mk:183: re

core: fix generation of tee.bin

Prior to this patch generation of tee.bin (CFG_WITH_PAGER=n) fails with:
GEN out/core/tee.bin
Cannot find symbol __init_end
core/arch/arm/kernel/link.mk:183: recipe for target 'out/core/tee.bin' failed

Introduce a special __get_tee_init_end to fix this and also avoid
confusion with __init_end used in the code for the pager case.

Fixes: 5dd1570ac5b0 ("core: add embedded data region")
Acked-by: Jerome Forissier <jerome@forissier.org>
Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>

show more ...


# 2338a971 23-Nov-2019 Jerome Forissier <jerome@forissier.org>

scripts/gen_tee_bin.py: convert symbol and section name to strings

Older versions of pyelftools return symbol and section names as byte
arrays rather than plain strings. As a result, symbols are not

scripts/gen_tee_bin.py: convert symbol and section name to strings

Older versions of pyelftools return symbol and section names as byte
arrays rather than plain strings. As a result, symbols are not found:

$ make
...
GEN out/arm/core/tee-header_v2.bin
Cannot find symbol _start
core/arch/arm/kernel/link.mk:191: recipe for target 'out/arm/core/tee-header_v2.bin' failed
make[1]: *** [out/arm/core/tee-header_v2.bin] Error 1

(This error was observed when building on Ubuntu 16.04.)

Signed-off-by: Jerome Forissier <jerome@forissier.org>
Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org>

show more ...


# f77987ae 21-Nov-2019 Jens Wiklander <jens.wiklander@linaro.org>

core: fix gen_tee_bin.py to handle STB_LOCAL symbols

Prior to this patch scripts/gen_tee_bin.py only looked for global
symbols (STB_GLOBAL). The linker in some older versions of the gcc
toolchain ma

core: fix gen_tee_bin.py to handle STB_LOCAL symbols

Prior to this patch scripts/gen_tee_bin.py only looked for global
symbols (STB_GLOBAL). The linker in some older versions of the gcc
toolchain makes some of the symbols local (STB_LOCAL) instead. This
patch fixes that by falling back to a local symbol in case a global
cannot be found.

Reviewed-by: Jerome Forissier <jerome@forissier.org>
Reported-by: Victor Chong <victor.chong@linaro.org>
Fixes: 3c51966baa03 ("core: add scripts/gen_tee_bin.py for boot binaries")
Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>

show more ...


# 5966660c 21-Oct-2019 Jens Wiklander <jens.wiklander@linaro.org>

core: move relocation to embedded data region

The relocation sections are placed last in the linker script to be kept
out of the way for the other sections. The relocation sections are
interpreted b

core: move relocation to embedded data region

The relocation sections are placed last in the linker script to be kept
out of the way for the other sections. The relocation sections are
interpreted by gen_tee_bin.py and converted into a more compact data
structure which is stored in the embedded data region.

For each relocation, only one 32-bit offset is kept. Compared to the
standard ELF format, the size of the relocation table is either halved
(Rel32 type: two 32-bit words per entry) or divided by 6 (Rel64 type:
three 64-bit words per entry).

Acked-by: Jerome Forissier <jerome@forissier.org>
Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>

show more ...


# 5dd1570a 21-Oct-2019 Jens Wiklander <jens.wiklander@linaro.org>

core: add embedded data region

Until this patch hashes has been supplied as a single blob following the
init part when configured for paging. To facilitate storing additional
data when OP-TEE is ini

core: add embedded data region

Until this patch hashes has been supplied as a single blob following the
init part when configured for paging. To facilitate storing additional
data when OP-TEE is initializing a struct boot_embdata is added. This
struct is populated gen_tee_bin.py and later interpreted by
assembly boot code and init_runtime().

Previous memory allocation for hashes in the linker script is replaced
by this new mechanism.

Acked-by: Jerome Forissier <jerome@forissier.org>
Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>

show more ...


# 3c51966b 18-Oct-2019 Jens Wiklander <jens.wiklander@linaro.org>

core: add scripts/gen_tee_bin.py for boot binaries

Adds scripts/gen_tee_bin.py which can produce the boot binaries instead
of objdump and scripts/gen_hashed_bin.py.

Reviewed-by: Jerome Forissier <j

core: add scripts/gen_tee_bin.py for boot binaries

Adds scripts/gen_tee_bin.py which can produce the boot binaries instead
of objdump and scripts/gen_hashed_bin.py.

Reviewed-by: Jerome Forissier <jerome@forissier.org>
Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>

show more ...