[PATCH] D129401: [libLTO] Set data-sections by default in libLTO for ELF and XCOFF.

wael yehia via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jul 11 10:59:28 PDT 2022


w2yehia added a comment.

LGTM



================
Comment at: llvm/lib/LTO/LTOCodeGenerator.cpp:351
+  llvm::Triple::ObjectFormatType ObjectFormat = Triple.getObjectFormat();
+  if (!codegen::getExplicitDataSections() &&
+      (ObjectFormat == llvm::Triple::ObjectFormatType::ELF ||
----------------
quinnp wrote:
> w2yehia wrote:
> > any reason we do this for ELF and XCOFF only?
> I don't think there is a particular reason that we do this for ELF and XCOFF only. We needed this fixed for `AIX` (`XCOFF`) and wanted to change `Linux` (`ELF`) to match the behaviour of `lld`/`gold` at the same time. I'm not sure what other file formats need for this so I did not include them.
> 
> @hubert.reinterpretcast might have a better answer for this.
I don't know either about the other formats, was just wondering.
I think it's safe to do it for the file formats that we know are currently different between libLTO and lld/gold. The proposed change is an improvement with minimal risk.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D129401



More information about the llvm-commits mailing list