[PATCH] D129401: [libLTO] Set data-sections by default in libLTO for ELF and XCOFF.
Hubert Tong via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Mon Jul 18 09:42:23 PDT 2022
hubert.reinterpretcast added inline comments.
================
Comment at: llvm/lib/LTO/LTOCodeGenerator.cpp:351
+ llvm::Triple::ObjectFormatType ObjectFormat = Triple.getObjectFormat();
+ if (!codegen::getExplicitDataSections() &&
+ (ObjectFormat == llvm::Triple::ObjectFormatType::ELF ||
----------------
w2yehia wrote:
> 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.
I agree with @w2yehia that we should change the data-sections to "on" by default in libLTO for the other file formats where one of lld/the gold plugin sets it to "on".
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