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

Shoaib Meenai via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri May 1 17:17:18 PDT 2020


smeenai 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;
----------------
int3 wrote:
> 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
Ah, sorry, I was just wondering why these weren't constants. I didn't mean to imply that you had to do it in this diff, but thanks for taking care of it :)

@int3 interesting, this appears to be a Catalina vs older OS thing. Possibly related to dyld3?


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