[llvm] [BOLT][AArch64] Create entry points for addresses referenced by dynamic relocations and allow getNewFunctionOrDataAddress to map addrs inside functions. (PR #120267)

Amir Ayupov via llvm-commits llvm-commits at lists.llvm.org
Tue Dec 17 14:01:00 PST 2024


================
@@ -0,0 +1,39 @@
+# RUN: llvm-mc -filetype=obj -triple aarch64-unknown-unknown %s -o %t.o
+# RUN: %clang %cflags %t.o -o %t.exe -Wl,-q
+# RUN: llvm-bolt %t.exe -o %t.bolt 2>&1 | FileCheck %s
+
+## Before bolt could handle mapping addresses within moved functions, it
+## would bail out with an error of the form:
+## BOLT-ERROR: unable to get new address corresponding to input address 0x10390 in function main. Consider adding this function to --skip-funcs=...
+## These addresses arise if computed GOTO is in use.
+## Check that bolt does not emit any error.
+
+# CHECK-NOT: BOLT-ERROR
----------------
aaupov wrote:

Please check whether 
- Label0 and Label1 have dynamic relocations, 
- that we register entry points for them, 
- that BOLT actually processes the containing function, 
- and that we properly update these dyn relocs.

https://github.com/llvm/llvm-project/pull/120267


More information about the llvm-commits mailing list