Searched hist:f2a67cf8a417282ce41ff4b4978db45971deb872 (Results 1 – 1 of 1) sorted by relevance
| /optee_os/ta/arch/arm/ |
| H A D | ta.ld.S | f2a67cf8a417282ce41ff4b4978db45971deb872 Wed May 15 08:55:18 UTC 2019 Jerome Forissier <jerome.forissier@linaro.org> ta: ta.ld.S: move .dynamic section next to .got
Changes the TA linker script so that the .dynamic section is adjacent to the .got section. This prepares for using the Clang compiler (more precisely: the LLVM linker, ld.lld).
Contrary to GCC, Clang enables the "RELRO" feature (RELocations Read- Only) by default. In a nutshell: RELRO causes the linker to emit an additional segment called RELRO, which tells the program loader that a part of the binary may be turned to read-only mode once the relocations are done. The goal is to increase protection against arbitrary code execution attacks. The sections that are concerned are .got and .dynamic, among others. Since there is only one RELRO segment, the sections that are supposed to be covered have to be contiguous. If they are not (which is currently the case in ta.ld.S), ld.lld shows an error:
ld.lld: error: section: .dynamic is not contiguous with other relro sections
Therefore, move .dynamic next to .got so that all the RELRO-eligible sections are contiguous.
Note: another option to fix this issue is to pass '-z norelro' to the linker, but that would obviously prevent future support of RELRO in the TA loader.
Signed-off-by: Jerome Forissier <jerome.forissier@linaro.org> Acked-by: Jens Wiklander <jens.wiklander@linaro.org>
|