[llvm] [BOLT] Account for stubs with symbols in plt (PR #192716)
Maksim Panchenko via llvm-commits
llvm-commits at lists.llvm.org
Thu Apr 30 13:01:47 PDT 2026
================
@@ -0,0 +1,44 @@
+# Test that BOLT correctly skips mold-style STT_FUNC symbols in PLT sections.
+
+# REQUIRES: system-linux
+# RUN: llvm-mc -filetype=obj -triple aarch64-linux %s -o %t.o
+# RUN: ld.lld -pie %t.o -o %t --emit-relocs
+# RUN: llvm-bolt %t -o %t.bolt --print-cfg --print-only=_start 2>&1 | FileCheck %s
+# RUN: llvm-readobj --syms %t.bolt | grep -A6 printf$plt | FileCheck %s --check-prefix=CHECK-SYM
+
+# CHECK-NOT: bl printf$plt
+# CHECK: bl printf
----------------
maksfb wrote:
In my example above, there's a line that builds an external library with defined `printf`. You can use that.
```
# RUN: %clang %cflags %p/../Inputs/stub.c -fPIC -shared -o %t.so
# RUN: %clang %cflags %s -o %t -nostdlib -Wl,-q %t.so
...
https://github.com/llvm/llvm-project/pull/192716
More information about the llvm-commits
mailing list