[PATCH] D107533: [lld-macho] Handle encoding personalities of same names but different kinds

Vy Nguyen via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Sep 10 14:21:27 PDT 2021


oontvoo added inline comments.


================
Comment at: lld/MachO/UnwindInfoSection.cpp:158-159
+// a Dylib symbol with the same name.
+// We do this because sometimes personality symbols are intentionally
+// defined as a local symbol as hack to get around another bug. As
+// a result, often we see two of the same personality symbols but different
----------------
int3 wrote:
> hm, what do you mean "intentionally defined ... as a hack to get around another bug"? Did you figure out why `ld -r` is emitting these local symbols?
To be clear, the "bug" here is *NOT* that `ld -r` produces local symbols for previously private extern symbols .  In fact, it seems sort of reasonable(in hindsight  😊) - if you consider  the output of `ld -r` to be a shared library, then making sure private symbols remain local makes sense.

The "bug" here is that the LD64  incorrectly thinks symbols from one of our `.o` files were not used, and therefore strip them from the final output when we run `ld -r`. We've been working around this by having an additional `.o` file containing the personality symbol as a local symbol.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D107533



More information about the llvm-commits mailing list