[PATCH] D115775: [lld-macho] Handle $ld$hide[$os] symbols.

Jez Ng via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Dec 17 12:17:13 PST 2021


int3 added inline comments.


================
Comment at: lld/MachO/InputFiles.cpp:1277
+    case SymbolKind::ObjectiveCInstanceVariable: // Fallthrough
+      normalSymbols.push_back({symbol->getName(), symbol->getKind()});
+    }
----------------
why not just push back a pointer to `symbol`? `InterfaceSymbol` seems redundant


================
Comment at: lld/test/MachO/Inputs/libReexportSystem2.tbd:1
+--- !tapi-tbd-v3
+archs:            [ i386, x86_64 ]
----------------
oontvoo wrote:
> This needs to be a standalone tbd because llvm-lit doesn't seem to understand tbd-v3 any more and I need the `re-exports: [filename]` for my test.
weird, what's the error?

but in any case tbdv4 does support reexports too, see e.g. `Inputs/libStubLink.tbd`


================
Comment at: lld/test/MachO/special-symbol-ld-hidden.s:24-27
+.long	_xxx at GOTPCREL
+.long _OBJC_CLASS_$_foo11 at GOTPCREL
+.long _OBJC_CLASS_$_foo10 at GOTPCREL
+.long _OBJC_CLASS_$_bar at GOTPCREL
----------------
oontvoo wrote:
> int3 wrote:
> > shouldn't this be `.quad`? I believe `.long` is for 32-bit values
>  it needed to be 32-bit because of the @GOTPCREL
> 
oh right. it's weird to use GOTPCREL like this though, since this isn't actually an instruction stream. I think `.quad _xxx` makes more sense if you just want to add a reference to a symbol

most of our other tests do that too


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D115775



More information about the llvm-commits mailing list