[lld] [lld][test][PAC] Do not rely on concrete offsets in LTO tests (PR #143358)

Daniil Kovalev via llvm-commits llvm-commits at lists.llvm.org
Tue Jun 17 07:50:35 PDT 2025


================
@@ -37,16 +37,26 @@ target triple = "aarch64-unknown-linux-gnu"
 @g3 = external global ptr
 @g4 = external global ptr
 
-define void @func() {
+; Minor codegen changes may influence function sizes and thus move subsequent
+; symbols. To prevent accidental changes to symbol addresses, request an
+; alignment that is larger than any expected function's size.
+;
+; Note that it is handy to have a trivial function like _start at the end of
+; the .text section, as most offsets of interest point to the dynamic section,
+; and one cannot easily control its alignment. On the other hand, the _start
+; function almost certainly contains a single ret instruction and is itself
+; aligned, making offsets of the subsequent sections predictable.
----------------
kovdan01 wrote:

Deleted, thanks, see 9d9462608fda2bf21a56524a7951a4b06711b737

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


More information about the llvm-commits mailing list