[PATCH] D152973: [gold] Add preliminary FatLTO support to the Gold plugin

Fangrui Song via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sat Jun 17 18:10:07 PDT 2023


MaskRay added a comment.

How does gold recognize `.llvm.lto` section for LTO?



================
Comment at: llvm/test/LTO/X86/Inputs/llvm.lto.section.s:1
+.section .llvm.lto
+.incbin "llvm.lto.section.bc"
----------------
This is a small extra file. You can use `split-file` to avoid the extra file.

`.section .llvm.lto,"e"`


================
Comment at: llvm/test/tools/gold/X86/fatlto/fatlto.test:4
+;; Clean up and initialize test dir
+; RUN: rm -rf %t
+; RUN: mkdir -p %t
----------------
As in the lld patch, `; RUN: rm -rf %t && mkdir %t && cd %t`


================
Comment at: llvm/test/tools/gold/X86/fatlto/fatlto.test:11
+; RUN: llvm-objcopy --add-section=.llvm.lto=%t/a-fatLTO.bc %t/a-fatLTO.o
+; RUN: llvm-objcopy --set-section-flags=.llvm.lto=exclude %t/a-fatLTO.o
+; RUN: llvm-readobj -S %t/a-fatLTO.o | FileCheck --check-prefix=CHECK-A %s
----------------
`readonly,exclude`


================
Comment at: llvm/test/tools/gold/X86/fatlto/fatlto.test:55
+; RUN: obj2yaml %t/foo-fatNoLTO > %t/foo-fatNoLTO.yaml
+; RUN: obj2yaml %t/foo-noLTO > %t/foo-noLTO.yaml
+; RUN: diff %t/foo-fatNoLTO.yaml %t/foo-noLTO.yaml
----------------
As in the lld patch, just use `cmp` to compare object files.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D152973/new/

https://reviews.llvm.org/D152973



More information about the llvm-commits mailing list