[PATCH] D157657: [RISCV] Support R_RISCV_SET_ULEB128/R_RISCV_SUB_ULEB128 for .uleb128 directives
Fangrui Song via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Sun Aug 27 23:50:32 PDT 2023
MaskRay added inline comments.
================
Comment at: llvm/lib/MC/MCAssembler.cpp:1020-1022
+ bool Abs = LF.getValue().evaluateAsAbsolute(Value, Layout);
if (!Abs) {
+ if (!getBackend().relaxLEB128(LF, Layout, Value)) {
----------------
vpalatin wrote:
> I'm seeing a failure on 'lld :: MachO/compact-unwind-lsda-folding.s' with this part of the change
>
>
> ```
> ******************** TEST 'lld :: MachO/compact-unwind-lsda-folding.s' FAILED ********************
> Script:
> --
> : 'RUN: at line 6'; rm -rf build.ASSERT/tools/lld/test/MachO/Output/compact-unwind-lsda-folding.s.tmp; mkdir build.ASSERT/tools/lld/test/MachO/Output/compact-unwind-lsda-folding.s.tmp
> : 'RUN: at line 7'; build.ASSERT/bin/llvm-mc -filetype=obj -triple=x86_64-apple-macos11.0 -emit-compact-unwind-non-canonical=true -o build.ASSERT/tools/lld/test/MachO/Output/compact-unwind-lsda-folding.s.tmp/lsda.o lld/test/MachO/compact-unwind-lsda-folding.s
> : 'RUN: at line 8'; ld64.lld -arch x86_64 -platform_version macos 11.0 11.0 -syslibroot lld/test/MachO/Inputs/MacOSX.sdk -lSystem -fatal_warnings -dylib --icf=all -lSystem -lc++ -o build.ASSERT/tools/lld/test/MachO/Output/compact-unwind-lsda-folding.s.tmp/liblsda.dylib build.ASSERT/tools/lld/test/MachO/Output/compact-unwind-lsda-folding.s.tmp/lsda.o
> : 'RUN: at line 9'; build.ASSERT/bin/llvm-objdump --macho --syms --unwind-info build.ASSERT/tools/lld/test/MachO/Output/compact-unwind-lsda-folding.s.tmp/liblsda.dylib | build.ASSERT/bin/FileCheck lld/test/MachO/compact-unwind-lsda-folding.s
> --
> Exit Code: 1
>
> Command Output (stderr):
> --
> lld/test/MachO/compact-unwind-lsda-folding.s:87:21: error: .uleb128 expression is not absolute
> .uleb128 Lfunc_end0-Ltmp1 ## Call between Ltmp1 and Lfunc_end0
> ```
Thanks. I added a llvm/test/MC test in 04c1e521b9547944333379528e8519f14e4a665c as this hasn't been tested by llvm/ before. Thanks to smeenai for creating this test!
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D157657/new/
https://reviews.llvm.org/D157657
More information about the llvm-commits
mailing list