[PATCH] D109109: [MC] Recursively calculate symbol offset

Fangrui Song via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Sep 27 13:00:27 PDT 2021


MaskRay added a subscriber: nickdesaulniers.
MaskRay added a comment.

In D109109#3025650 <https://reviews.llvm.org/D109109#3025650>, @lgrey wrote:

> Oof! That does sound prohibitively difficult.
>
> @MaskRay is the mutual reference issue that you referred to tractable?

@lgrey I am just concerned that some configurations of the Linux kernel's Clang build may hit a behavior change here (I do remember symbol reassignments from some assembly files), but it is possible that I am overly worried.

@nickdesaulniers may assist on testing the patch (with just the `llvm/lib/MC/MCFragment.cpp` change)

In any case, the `llvm/lib/MC/MCFragment.cpp` changes need a FIXME comment that it works around the Mach-O issue and is not needed for other binary formats.

---

> (1) We introduce an assembly directive that describes the expected assignment behavior: .llvm_pr19203=fixed|compat. On MachO, we could emit a warning when we encounter a buggy expression if that directive is unset, or set to compat: "Warning: Using llvm_pr19203 compat mode. Please audit or or regenerate your assembly, then switch to fixed". This directive would probably hang around forever (once it's added to the source it's going to be hard to get rid of again).

I think such a Mach-O specific diagnostic will be useful in `evaluateAsRelocatableImpl`. Hope either of you can implement it.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D109109



More information about the llvm-commits mailing list