[PATCH] D112500: [lld-macho] Put GOT into `__DATA` segment where appropriate

Vy Nguyen via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Oct 25 17:43:26 PDT 2021


oontvoo accepted this revision.
oontvoo added a comment.
This revision is now accepted and ready to land.

LGTM



================
Comment at: lld/MachO/SyntheticSections.cpp:262
 GotSection::GotSection()
-    : NonLazyPointerSectionBase(segment_names::dataConst, section_names::got) {
+    : NonLazyPointerSectionBase(segment_names::data, section_names::got) {
   flags = S_NON_LAZY_SYMBOL_POINTERS;
----------------
int3 wrote:
> oontvoo wrote:
> > oontvoo wrote:
> > > it's still not quite correct to unconditionally put it in non-const, though.
> > > (there's the `-data_const` flag for one )
> > > 
> > > 
> > > 
> > P.S: I dont actually have a strong opinion either way. But could we at least have a FIXME or note here for future work?
> that's already being done in `initializeSectionRenameMap` in Driver.cpp :)
> 
> the problem was that we would only rename from non-const to const, and not the other way around. So initializing the section to a const segment here meant that we would never emit it as non-const...
Ah, I see. Sorry for the noise then!


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D112500



More information about the llvm-commits mailing list