ARM-software / tf-issues

Issue tracking for the ARM Trusted Firmware project
37 stars 16 forks source link

BL31: Add support for scatter files #662

Closed vwadekar closed 5 years ago

vwadekar commented 5 years ago

NVIDIA plans to use the TF-A codebase with the 'armlink' linker instead of GCC. 'armlink' expects a new linker script called as a scatter file as it does not fully support ld.S scripts.

This issue will track the work required to introduce a generic scatter file for the BL31 code, that can be (re)used by all platforms.

These are the tentative sub-tasks

Tentative ETA: 1/18

Note: the plan is to use local Tegra builds as much as possible to verify these changes and rely on the ARM build system to compile for all other platforms.

soby-mathew commented 5 years ago

@vwadekar, we had done a preliminary evaluation for using the scatter gather format within the team and found the following limitations (but you may have found solutions for them) :

  1. Support for dynamic relocation/Position independent executable (PIE) support for AArch64 does not seem to be present.
  2. Overlay capability is insufficient to support existing FVP build.
  3. Forward references of linker symbols are not allowed in SG format. We use this capability for specifying overlays from within platform linker script which references symbols defined by later by main linker script.
  4. Ability to specify exclude file list from sections is lacking.

Hence I think it might be difficult to support this format generically. But please raise a PR and we can evaluate it.

vwadekar commented 5 years ago

Partial changes are part of PR https://github.com/ARM-software/arm-trusted-firmware/pull/1759

vwadekar commented 5 years ago

@soby-mathew

All the problems you listed do exist and there is no silver bullet to fix them AFAIK. But Tegra does not use most of the features you listed so it benefits directly from this change.

For ARM platforms, we will have to find a way to support the same features in a different way if you are interested in supporting armlink. If not, then we can make it a platform specific feature and ARM platforms can just keep it disabled.

vwadekar commented 5 years ago

The actual scatter file is part of PR https://github.com/ARM-software/arm-trusted-firmware/pull/1751