[PATCH] D77893: [lld] Merge Mach-O input sections

Jez Ng via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri May 1 00:50:43 PDT 2020


int3 added inline comments.


================
Comment at: lld/MachO/SyntheticSections.cpp:70
 
-GotSection::GotSection() {
-  segname = "__DATA_CONST";
-  name = "__got";
+GotSection::GotSection() : SyntheticSection("__DATA_CONST", "__got") {
   align = 8;
----------------
Ktwu wrote:
> int3 wrote:
> > smeenai wrote:
> > > @int3 how come these strings are just here directly vs. all the other ones being named constants?
> > > 
> > > Also, not this diff, but is `__DATA_CONST` correct? ld64 puts this in `__DATA` instead as far as I can see. It's not quite constant cos the dynamic linker's gonna fill it in, though idk if it has the equivalent to ELF's RELRO.
> > I don't think we're currently referencing this from anywhere else (in particular I didn't give them an order in the sorting comparator), so it wasn't technically necessary, though we could definitely make them constants for the sake of uniformity
> I'll make 'em a constant for now; can we deal with __DATA vs __DATA_CONST in another diff if need be?
Oh sorry I missed the 2nd part of the comment about the segment. I'm pretty sure it's in `__DATA_CONST` at least on Catalina; just tried it out. But yeah we can deal with it in another diff if necessary


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D77893





More information about the llvm-commits mailing list