[lld] [lld][ELF] Enable link script to support absolute path matching (PR #156353)

Peter Smith via llvm-commits llvm-commits at lists.llvm.org
Tue Sep 2 02:07:05 PDT 2025


================
@@ -0,0 +1,56 @@
+# REQUIRES: x86
+# RUN: rm -rf %t && mkdir -p %t
+# RUN: split-file %s %t && cd %t
+
+# RUN: llvm-mc -filetype=obj -triple=x86_64 main.s -o main.o
+
+# RUN: llvm-mc -filetype=obj -triple=x86_64 foo.s -o foo.o
+# RUN: llvm-objcopy --rename-section .text=.text_foo  foo.o foo.o
+
+# RUN: llvm-mc -filetype=obj -triple=x86_64 bar.s -o bar.o
+# RUN: llvm-objcopy --rename-section .text=.text_bar  bar.o bar.o
+
+# RUN: ld.lld -r main.o %t/foo.o %t/bar.o -T script.ld -o main_abs.o
+
+# RUN: llvm-objdump -S main_abs.o > main_abs
+# RUN: llvm-objdump -S main_abs.o | FileCheck %s
+# CHECK: Disassembly of section .goo:
----------------
smithp35 wrote:

If the intent is to show that `.text_foo` and `.text_bar` have been placed in .goo I think checking the output of the linker `-Map` is more direct. You wouldn't need to use llvm-objdump at all then.  

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


More information about the llvm-commits mailing list