[PATCH] D102143: [lld-macho] Treat undefined symbols uniformly

Jez Ng via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sun May 9 21:45:25 PDT 2021


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

Bah, I accidentally removed you as the reviewer when doing `arc diff --verbatim`. I've made a bunch of changes since you stamped it though, might be worth to have another quick look...

> Interesting! Do you know of anything that actually does this?

Nope, it was just something that occurred to me to test as I was reviewing our entry symbol handling...



================
Comment at: lld/MachO/Driver.cpp:1143
     // via -u flag twice.
     for (const Symbol *undefined : config->explicitUndefineds) {
       if (isa<Undefined>(undefined)) {
----------------
thakis wrote:
> I think this needs basically the same change. `-u _foo -undefined dynamic_lookup` forces a dynamically-looked-up symbol `foo` to exist at load time with ld64. (Can't really think of a use case for that either, but since it's next to the entry point right now and behaves the same way right now, this should probably receive the same treatment in this change.)
good point... looks like `-exported_symbol` needs the same treatment too. I've verified that ld64 does apply the same behavior to them, and this diff has been expanded accordingly.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D102143



More information about the llvm-commits mailing list