[lld] [lld][NFC] Precommit test for ld -r links FatLTO PIC objects (PR #92817)
Fangrui Song via llvm-commits
llvm-commits at lists.llvm.org
Mon May 20 21:54:56 PDT 2024
================
@@ -49,6 +49,25 @@
; RUN: ld.lld -o %t/foo-fatLTO.archive %t/a.a %t/main-LTO.bc --fat-lto-objects
; RUN: cmp %t/foo-fatLTO.archive %t/foo-LTO
+;; Test FatLTO works with relocatable links using PIC objects
+;; Currently, with PIC relocatable links, FatLTO sections are treated as
+;; orphan sections and incorrectly concatenated together. This test verifies
+;; the current behavior, but should be fixed to either merge those sections
+;; correctly, or to drop them altogether.
+; RUN: opt < %t/a-LTO.ll -passes="embed-bitcode<thinlto;emit-summary>" | llc --relocation-model=pic --filetype=obj -o %t/a-fat-pic.o
----------------
MaskRay wrote:
You can `-r` link main-LTO.ll and a-LTO.ll instead of adding `b-LTO.ll`.
llvm-objcopy --add-section isn't bad. It's explicit in the operation.
https://github.com/llvm/llvm-project/pull/92817
More information about the llvm-commits
mailing list