[PATCH] D78342: [lld] Add archive file support to Mach-O backend

Kellie Medlin via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu May 7 12:28:23 PDT 2020


Ktwu marked 5 inline comments as done.
Ktwu added inline comments.


================
Comment at: lld/test/MachO/Inputs/archive4.s:1
+.global _lonely
+_alone:
----------------
smeenai wrote:
> Directive doesn't match symbol name below
This was on purpose; I thought it'd be useful to have both a declaration and a definition that don't link up to anything.

If that's not actually useful (or if I should be explicit), I'll change it.


================
Comment at: lld/test/MachO/archive.s:15
+# CHECK-NEXT: T _boo
+# CHECK-NEXT: T _main
+
----------------
smeenai wrote:
> We'll wanna add a `CHECK-NOT` for `_lonely`/`_alone` (depending on what you decide to call that symbol), to make sure that archive member wasn't pulled in.
> 
> Unfortunately, that depends on the order symbols are printed out by nm, so it's not completely reliable. As in, if we did have `_alone` in the symbol table (because we incorrectly pulled in that archive member), and nm printed it out before `_bar`, having a `CHECK-NOT: T _alone` after this line wouldn't do us any good. Having a second `CHECK-NOT` before the `CHECK` for `_bar` should be enough to make this work, I think.
I can also rerun `llvm-nm %t.out` explicitly to make sure that the symbols don't appear anywhere, right? That way I wouldn't have to worry about ordering.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D78342





More information about the llvm-commits mailing list