Issue 241083
Summary [lld][AArch64] Unnecessary padding in PLT entries with BTI and/or pac-plt
Labels lld:ELF
Assignees
Reporter efriedma-quic
    When a binary is built for aarch64, and either BTI is enabled, or pac-plt is enabled, the PLT entry size is unconditionally set to 24 bytes.  However, in some common scenarios, all PLT entries only have 16 bytes of actual code, and just get padded with nops.

The easiest way to hit this is to build a program with -mbranch-protection=standard:

```
echo "void f(); void g() { f(); }" > test.c
clang test.c -o test -fuse-ld=lld -nostdlib -shared --target=aarch64-linux-gnu -mbranch-protection=standard
llvm-objdump -d test
```

`f@plt` is padded with two unnecessary nops.
_______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to