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

Jez Ng via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Oct 25 17:38:00 PDT 2021


int3 marked an inline comment as done.
int3 added inline comments.


================
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;
----------------
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...


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