HomePhabricator

[ELF] Implement option to force PIC compatible Thunks

Description

[ELF] Implement option to force PIC compatible Thunks

By default LLD will generate position independent Thunks when the --pie or
--shared option is used. Reference to absolute addresses is permitted in
other cases. For some embedded systems position independent thunks are
needed for code that executes before the MMU has been set up. The option
--pic-veneer is used by ld.bfd to force position independent thunks.

The patch adds --pic-veneer as the option is needed for the Linux kernel
on Arm.

fixes pr39886

Differential Revision: https://reviews.llvm.org/D55505