[lld] [WIP][lld] Support thumb PLTs for cortex-M (PR #86223)
via llvm-commits
llvm-commits at lists.llvm.org
Fri Mar 22 17:06:44 PDT 2024
================
@@ -231,36 +231,68 @@ static void writePltHeaderLong(uint8_t *buf) {
// The default PLT header requires the .got.plt to be within 128 Mb of the
// .plt in the positive direction.
void ARM::writePltHeader(uint8_t *buf) const {
- // Use a similar sequence to that in writePlt(), the difference is the calling
- // conventions mean we use lr instead of ip. The PLT entry is responsible for
- // saving lr on the stack, the dynamic loader is responsible for reloading
- // it.
- const uint32_t pltData[] = {
- 0xe52de004, // L1: str lr, [sp,#-4]!
- 0xe28fe600, // add lr, pc, #0x0NN00000 &(.got.plt - L1 - 4)
- 0xe28eea00, // add lr, lr, #0x000NN000 &(.got.plt - L1 - 4)
- 0xe5bef000, // ldr pc, [lr, #0x00000NNN] &(.got.plt -L1 - 4)
- };
+ if (!config->armAlwaysThumb) {
----------------
PiJoules wrote:
Updated the config name and the conditions for setting it. I think they align with your criteria.
https://github.com/llvm/llvm-project/pull/86223
More information about the llvm-commits
mailing list