• Soby Mathew's avatar
    PIE: Position Independant Executable support for BL31 · 931f7c61
    Soby Mathew authored
    
    
    This patch introduces Position Independant Executable(PIE) support
    in TF-A. As a initial prototype, only BL31 can support PIE. A trivial
    dynamic linker is implemented which supports fixing up Global Offset
    Table(GOT) and Dynamic relocations(.rela.dyn). The fixup_gdt_reloc()
    helper function implements this linker and this needs to be called
    early in the boot sequence prior to invoking C functions. The GOT is
    placed in the RO section of BL31 binary for improved security and the
    BL31 linker script is modified to export the appropriate symbols
    required for the dynamic linker.
    
    The C compiler always generates PC relative addresses to linker symbols
    and hence referencing symbols exporting constants are a problem when
    relocating the binary. Hence the reference to the
    `__PERCPU_TIMESTAMP_SIZE__` symbol in PMF is removed and is now calculated
    at runtime based on start and end addresses.
    
    Change-Id: I1228583ff92cf432963b7cef052e95d995cca93d
    Signed-off-by: default avatarSoby Mathew <soby.mathew@arm.com>
    931f7c61
pmf_main.c 6.89 KB