Skip to content

AsmPrinter: Remove ELF's special lowerRelativeReference for unnamed_addr function #132684

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Conversation

MaskRay
Copy link
Member

@MaskRay MaskRay commented Mar 24, 2025

https://reviews.llvm.org/D17938 introduced lowerRelativeReference to
give ConstantExpr sub (A-B) special semantics in ELF: when A is an
unnamed_addr function, create a PLT-generating relocation. This was
intended for C++ relative vtables, but C++ relative vtable ended up
using DSOLocalEquivalent (lowerDSOLocalEquivalent).

This special treatment of unnamed_addr seems unusual.
Let's remove it. Only COFF needs an overload to generate a @IMGREL32
relocation specifier (llvm/test/MC/COFF/cross-section-relative.ll).

Created using spr 1.3.5-bogner
@MaskRay MaskRay requested a review from pcc March 24, 2025 07:28
@llvmbot
Copy link
Member

llvmbot commented Mar 24, 2025

@llvm/pr-subscribers-backend-arm

@llvm/pr-subscribers-backend-x86

Author: Fangrui Song (MaskRay)

Changes

https://reviews.llvm.org/D17938 introduced lowerRelativeReference to
give ConstantExpr sub (A-B) special semantics in ELF: when A is an
unnamed_addr function, create a PLT-generating relocation. This was
intended for C++ relative vtables, but C++ relative vtable ended up
using DSOLocalEquivalent (lowerDSOLocalEquivalent).

This special treatment of unnamed_addr seems unusual.
Let's remove it. Only COFF needs an overload to generate a @IMGREL32
relocation specifier (llvm/test/MC/COFF/cross-section-relative.ll).


Full diff: https://github.com/llvm/llvm-project/pull/132684.diff

4 Files Affected:

  • (modified) llvm/include/llvm/CodeGen/TargetLoweringObjectFileImpl.h (-4)
  • (modified) llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp (-20)
  • (modified) llvm/test/CodeGen/X86/x86-64-plt-relative-reloc.ll (+3-2)
  • (modified) llvm/test/CodeGen/X86/x86-plt-relative-reloc.ll (+2-2)
diff --git a/llvm/include/llvm/CodeGen/TargetLoweringObjectFileImpl.h b/llvm/include/llvm/CodeGen/TargetLoweringObjectFileImpl.h
index 76571690eeda0..293aa9d1faf7d 100644
--- a/llvm/include/llvm/CodeGen/TargetLoweringObjectFileImpl.h
+++ b/llvm/include/llvm/CodeGen/TargetLoweringObjectFileImpl.h
@@ -112,10 +112,6 @@ class TargetLoweringObjectFileELF : public TargetLoweringObjectFile {
   MCSection *getStaticDtorSection(unsigned Priority,
                                   const MCSymbol *KeySym) const override;
 
-  const MCExpr *lowerRelativeReference(const GlobalValue *LHS,
-                                       const GlobalValue *RHS,
-                                       const TargetMachine &TM) const override;
-
   const MCExpr *lowerDSOLocalEquivalent(const DSOLocalEquivalent *Equiv,
                                         const TargetMachine &TM) const override;
 
diff --git a/llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp b/llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp
index 0e44acdd1dccc..0f6d0001087d9 100644
--- a/llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp
+++ b/llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp
@@ -1174,26 +1174,6 @@ MCSection *TargetLoweringObjectFileELF::getStaticDtorSection(
                                   KeySym);
 }
 
-const MCExpr *TargetLoweringObjectFileELF::lowerRelativeReference(
-    const GlobalValue *LHS, const GlobalValue *RHS,
-    const TargetMachine &TM) const {
-  // We may only use a PLT-relative relocation to refer to unnamed_addr
-  // functions.
-  if (!LHS->hasGlobalUnnamedAddr() || !LHS->getValueType()->isFunctionTy())
-    return nullptr;
-
-  // Basic correctness checks.
-  if (LHS->getType()->getPointerAddressSpace() != 0 ||
-      RHS->getType()->getPointerAddressSpace() != 0 || LHS->isThreadLocal() ||
-      RHS->isThreadLocal())
-    return nullptr;
-
-  return MCBinaryExpr::createSub(
-      MCSymbolRefExpr::create(TM.getSymbol(LHS), PLTRelativeSpecifier,
-                              getContext()),
-      MCSymbolRefExpr::create(TM.getSymbol(RHS), getContext()), getContext());
-}
-
 const MCExpr *TargetLoweringObjectFileELF::lowerDSOLocalEquivalent(
     const DSOLocalEquivalent *Equiv, const TargetMachine &TM) const {
   assert(supportDSOLocalEquivalentLowering());
diff --git a/llvm/test/CodeGen/X86/x86-64-plt-relative-reloc.ll b/llvm/test/CodeGen/X86/x86-64-plt-relative-reloc.ll
index f949c83efd03f..02b012cf18199 100644
--- a/llvm/test/CodeGen/X86/x86-64-plt-relative-reloc.ll
+++ b/llvm/test/CodeGen/X86/x86-64-plt-relative-reloc.ll
@@ -12,8 +12,9 @@ declare void @fn2() unnamed_addr
 declare void @fn3()
 @global4 = external unnamed_addr global i8
 
+;; Generate a PC-relative relocation, which might be rejected by the linker if the referenced symbol is preemptible.
 ; CHECK: .long 0
-; CHECK-NEXT: .long (fn1@PLT-vtable)-4
-; CHECK-NEXT: .long (fn2@PLT-vtable)-4
+; CHECK-NEXT: .long (fn1-vtable)-4
+; CHECK-NEXT: .long (fn2-vtable)-4
 ; CHECK-NEXT: .long (fn3-vtable)-4
 ; CHECK-NEXT: .long (global4-vtable)-4
diff --git a/llvm/test/CodeGen/X86/x86-plt-relative-reloc.ll b/llvm/test/CodeGen/X86/x86-plt-relative-reloc.ll
index 8c86cd29d1c81..ea5dd5b5a83a1 100644
--- a/llvm/test/CodeGen/X86/x86-plt-relative-reloc.ll
+++ b/llvm/test/CodeGen/X86/x86-plt-relative-reloc.ll
@@ -11,6 +11,6 @@ declare void @fn2() unnamed_addr
 declare void @fn3()
 
 ; CHECK: .long 0
-; CHECK-NEXT: .long (fn1@PLT-vtable)-4
-; CHECK-NEXT: .long (fn2@PLT-vtable)-4
+; CHECK-NEXT: .long (fn1-vtable)-4
+; CHECK-NEXT: .long (fn2-vtable)-4
 ; CHECK-NEXT: .long (fn3-vtable)-4

@MaskRay
Copy link
Member Author

MaskRay commented Mar 29, 2025

@pcc :)

MaskRay added 2 commits March 31, 2025 20:31
Created using spr 1.3.5-bogner
Created using spr 1.3.5-bogner
Created using spr 1.3.5-bogner
@MaskRay MaskRay merged commit dd86235 into main Apr 1, 2025
5 of 8 checks passed
@MaskRay MaskRay deleted the users/MaskRay/spr/asmprinter-remove-elfs-special-lowerrelativereference-for-unnamed_addr-function branch April 1, 2025 03:44
llvm-sync bot pushed a commit to arm/arm-toolchain that referenced this pull request Apr 1, 2025
…r unnamed_addr function

https://reviews.llvm.org/D17938 introduced lowerRelativeReference to
give ConstantExpr sub (A-B) special semantics in ELF: when `A` is an
`unnamed_addr` function, create a PLT-generating relocation. This was
intended for C++ relative vtables, but C++ relative vtable ended up
using DSOLocalEquivalent (lowerDSOLocalEquivalent).

This special treatment of `unnamed_addr` seems unusual.
Let's remove it. Only COFF needs an overload to generate a @IMGREL32
relocation specifier (llvm/test/MC/COFF/cross-section-relative.ll).

Pull Request: llvm/llvm-project#132684
@petrhosek
Copy link
Member

This broke the build of libc++abi for Fuchsia with the following error:

/b/s/w/ir/x/w/llvm_build/./bin/clang++ --target=x86_64-unknown-fuchsia --sysroot=/b/s/w/ir/x/w/sdk/arch/x64/sysroot -fPIC --target=x86_64-unknown-fuchsia -I/b/s/w/ir/x/w/sdk/pkg/sync/include -I/b/s/w/ir/x/w/sdk/pkg/fdio/include -fPIC -fno-semantic-interposition -fvisibility-inlines-hidden -Werror=date-time -Werror=unguarded-availability-new -Wno-unnecessary-virtual-specifier -Wall -Wextra -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wmissing-field-initializers -Wimplicit-fallthrough -Wcovered-switch-default -Wno-noexcept-type -Wnon-virtual-dtor -Wdelete-non-virtual-dtor -Wsuggest-override -Wstring-conversion -Wmisleading-indentation -Wctad-maybe-unsupported -ffunction-sections -fdata-sections -ffile-prefix-map=/b/s/w/ir/x/w/llvm_build/runtimes/runtimes-x86_64-unknown-fuchsia-bins=../../../llvm-llvm-project -ffile-prefix-map=/b/s/w/ir/x/w/llvm-llvm-project/= -no-canonical-prefixes  -O2 -g -DNDEBUG  -L/b/s/w/ir/x/w/sdk/arch/x64/lib -Wl,-z,defs -fuse-ld=lld  -Wl,--push-state,--as-needed,-lzircon,--pop-state -nostdlib++ --unwindlib=none -shared -Wl,-soname,libc++abi.so.1 -o /b/s/w/ir/x/w/llvm_build/lib/x86_64-unknown-fuchsia/libc++abi.so.1.0 libcxxabi/src/CMakeFiles/cxxabi_shared_objects.dir/cxa_aux_runtime.cpp.obj libcxxabi/src/CMakeFiles/cxxabi_shared_objects.dir/cxa_default_handlers.cpp.obj libcxxabi/src/CMakeFiles/cxxabi_shared_objects.dir/cxa_demangle.cpp.obj libcxxabi/src/CMakeFiles/cxxabi_shared_objects.dir/cxa_exception_storage.cpp.obj libcxxabi/src/CMakeFiles/cxxabi_shared_objects.dir/cxa_guard.cpp.obj libcxxabi/src/CMakeFiles/cxxabi_shared_objects.dir/cxa_handlers.cpp.obj libcxxabi/src/CMakeFiles/cxxabi_shared_objects.dir/cxa_vector.cpp.obj libcxxabi/src/CMakeFiles/cxxabi_shared_objects.dir/cxa_virtual.cpp.obj libcxxabi/src/CMakeFiles/cxxabi_shared_objects.dir/stdlib_exception.cpp.obj libcxxabi/src/CMakeFiles/cxxabi_shared_objects.dir/stdlib_stdexcept.cpp.obj libcxxabi/src/CMakeFiles/cxxabi_shared_objects.dir/stdlib_typeinfo.cpp.obj libcxxabi/src/CMakeFiles/cxxabi_shared_objects.dir/abort_message.cpp.obj libcxxabi/src/CMakeFiles/cxxabi_shared_objects.dir/fallback_malloc.cpp.obj libcxxabi/src/CMakeFiles/cxxabi_shared_objects.dir/private_typeinfo.cpp.obj libcxxabi/src/CMakeFiles/cxxabi_shared_objects.dir/stdlib_new_delete.cpp.obj libcxxabi/src/CMakeFiles/cxxabi_shared_objects.dir/cxa_exception.cpp.obj libcxxabi/src/CMakeFiles/cxxabi_shared_objects.dir/cxa_personality.cpp.obj libcxxabi/src/CMakeFiles/cxxabi_shared_objects.dir/cxa_thread_atexit.cpp.obj  -lc  /b/s/w/ir/x/w/llvm_build/lib/x86_64-unknown-fuchsia/libunwind.so.1.0 && :
ld.lld: error: relocation R_X86_64_PC32 cannot be used against symbol 'std::bad_cast::~bad_cast()'; recompile with -fPIC
>>> defined in libcxxabi/src/CMakeFiles/cxxabi_shared_objects.dir/stdlib_typeinfo.cpp.obj
>>> referenced by stdlib_typeinfo.cpp
>>>               libcxxabi/src/CMakeFiles/cxxabi_shared_objects.dir/stdlib_typeinfo.cpp.obj:(vtable for std::bad_cast (.local))

ld.lld: error: relocation R_X86_64_PC32 cannot be used against symbol 'std::bad_cast::~bad_cast()'; recompile with -fPIC
>>> defined in libcxxabi/src/CMakeFiles/cxxabi_shared_objects.dir/stdlib_typeinfo.cpp.obj
>>> referenced by stdlib_typeinfo.cpp
>>>               libcxxabi/src/CMakeFiles/cxxabi_shared_objects.dir/stdlib_typeinfo.cpp.obj:(vtable for std::bad_cast (.local))

ld.lld: error: relocation R_X86_64_PC32 cannot be used against symbol 'std::bad_cast::what() const'; recompile with -fPIC
>>> defined in libcxxabi/src/CMakeFiles/cxxabi_shared_objects.dir/stdlib_typeinfo.cpp.obj
>>> referenced by stdlib_typeinfo.cpp
>>>               libcxxabi/src/CMakeFiles/cxxabi_shared_objects.dir/stdlib_typeinfo.cpp.obj:(vtable for std::bad_cast (.local))

ld.lld: error: relocation R_X86_64_PC32 cannot be used against symbol 'std::bad_typeid::~bad_typeid()'; recompile with -fPIC
>>> defined in libcxxabi/src/CMakeFiles/cxxabi_shared_objects.dir/stdlib_typeinfo.cpp.obj
>>> referenced by stdlib_typeinfo.cpp
>>>               libcxxabi/src/CMakeFiles/cxxabi_shared_objects.dir/stdlib_typeinfo.cpp.obj:(vtable for std::bad_typeid (.local))

ld.lld: error: relocation R_X86_64_PC32 cannot be used against symbol 'std::bad_typeid::~bad_typeid()'; recompile with -fPIC
>>> defined in libcxxabi/src/CMakeFiles/cxxabi_shared_objects.dir/stdlib_typeinfo.cpp.obj
>>> referenced by stdlib_typeinfo.cpp
>>>               libcxxabi/src/CMakeFiles/cxxabi_shared_objects.dir/stdlib_typeinfo.cpp.obj:(vtable for std::bad_typeid (.local))

ld.lld: error: relocation R_X86_64_PC32 cannot be used against symbol 'std::exception::~exception()'; recompile with -fPIC
>>> defined in libcxxabi/src/CMakeFiles/cxxabi_shared_objects.dir/stdlib_exception.cpp.obj
>>> referenced by stdlib_exception.cpp
>>>               libcxxabi/src/CMakeFiles/cxxabi_shared_objects.dir/stdlib_exception.cpp.obj:(vtable for std::bad_alloc (.local))

ld.lld: error: relocation R_X86_64_PC32 cannot be used against symbol 'std::logic_error::~logic_error()'; recompile with -fPIC
>>> defined in libcxxabi/src/CMakeFiles/cxxabi_shared_objects.dir/stdlib_stdexcept.cpp.obj
>>> referenced by stdlib_stdexcept.cpp
>>>               libcxxabi/src/CMakeFiles/cxxabi_shared_objects.dir/stdlib_stdexcept.cpp.obj:(vtable for std::logic_error (.local))

ld.lld: error: relocation R_X86_64_PC32 cannot be used against symbol 'std::bad_typeid::what() const'; recompile with -fPIC
>>> defined in libcxxabi/src/CMakeFiles/cxxabi_shared_objects.dir/stdlib_typeinfo.cpp.obj
>>> referenced by stdlib_typeinfo.cpp
>>>               libcxxabi/src/CMakeFiles/cxxabi_shared_objects.dir/stdlib_typeinfo.cpp.obj:(vtable for std::bad_typeid (.local))

ld.lld: error: relocation R_X86_64_PC32 cannot be used against symbol 'std::logic_error::~logic_error()'; recompile with -fPIC
>>> defined in libcxxabi/src/CMakeFiles/cxxabi_shared_objects.dir/stdlib_stdexcept.cpp.obj
>>> referenced by stdlib_stdexcept.cpp
>>>               libcxxabi/src/CMakeFiles/cxxabi_shared_objects.dir/stdlib_stdexcept.cpp.obj:(vtable for std::logic_error (.local))

ld.lld: error: relocation R_X86_64_PC32 cannot be used against symbol 'std::type_info::~type_info()'; recompile with -fPIC
>>> defined in libcxxabi/src/CMakeFiles/cxxabi_shared_objects.dir/stdlib_typeinfo.cpp.obj
>>> referenced by stdlib_typeinfo.cpp
>>>               libcxxabi/src/CMakeFiles/cxxabi_shared_objects.dir/stdlib_typeinfo.cpp.obj:(vtable for std::type_info (.local))

ld.lld: error: relocation R_X86_64_PC32 cannot be used against symbol 'std::logic_error::what() const'; recompile with -fPIC
>>> defined in libcxxabi/src/CMakeFiles/cxxabi_shared_objects.dir/stdlib_stdexcept.cpp.obj
>>> referenced by stdlib_stdexcept.cpp
>>>               libcxxabi/src/CMakeFiles/cxxabi_shared_objects.dir/stdlib_stdexcept.cpp.obj:(vtable for std::logic_error (.local))

ld.lld: error: relocation R_X86_64_PC32 cannot be used against symbol 'std::type_info::~type_info()'; recompile with -fPIC
>>> defined in libcxxabi/src/CMakeFiles/cxxabi_shared_objects.dir/stdlib_typeinfo.cpp.obj
>>> referenced by stdlib_typeinfo.cpp
>>>               libcxxabi/src/CMakeFiles/cxxabi_shared_objects.dir/stdlib_typeinfo.cpp.obj:(vtable for std::type_info (.local))

ld.lld: error: relocation R_X86_64_PC32 cannot be used against symbol 'std::bad_alloc::~bad_alloc()'; recompile with -fPIC
>>> defined in libcxxabi/src/CMakeFiles/cxxabi_shared_objects.dir/stdlib_exception.cpp.obj
>>> referenced by stdlib_exception.cpp
>>>               libcxxabi/src/CMakeFiles/cxxabi_shared_objects.dir/stdlib_exception.cpp.obj:(vtable for std::bad_alloc (.local))

ld.lld: error: relocation R_X86_64_PC32 cannot be used against symbol 'std::bad_alloc::what() const'; recompile with -fPIC
>>> defined in libcxxabi/src/CMakeFiles/cxxabi_shared_objects.dir/stdlib_exception.cpp.obj
>>> referenced by stdlib_exception.cpp
>>>               libcxxabi/src/CMakeFiles/cxxabi_shared_objects.dir/stdlib_exception.cpp.obj:(vtable for std::bad_alloc (.local))

ld.lld: error: relocation R_X86_64_PC32 cannot be used against symbol 'std::exception::~exception()'; recompile with -fPIC
>>> defined in libcxxabi/src/CMakeFiles/cxxabi_shared_objects.dir/stdlib_exception.cpp.obj
>>> referenced by stdlib_exception.cpp
>>>               libcxxabi/src/CMakeFiles/cxxabi_shared_objects.dir/stdlib_exception.cpp.obj:(vtable for std::bad_array_new_length (.local))

ld.lld: error: relocation R_X86_64_PC32 cannot be used against symbol 'std::bad_array_new_length::~bad_array_new_length()'; recompile with -fPIC
>>> defined in libcxxabi/src/CMakeFiles/cxxabi_shared_objects.dir/stdlib_exception.cpp.obj
>>> referenced by stdlib_exception.cpp
>>>               libcxxabi/src/CMakeFiles/cxxabi_shared_objects.dir/stdlib_exception.cpp.obj:(vtable for std::bad_array_new_length (.local))

ld.lld: error: relocation R_X86_64_PC32 cannot be used against symbol 'std::runtime_error::~runtime_error()'; recompile with -fPIC
>>> defined in libcxxabi/src/CMakeFiles/cxxabi_shared_objects.dir/stdlib_stdexcept.cpp.obj
>>> referenced by stdlib_stdexcept.cpp
>>>               libcxxabi/src/CMakeFiles/cxxabi_shared_objects.dir/stdlib_stdexcept.cpp.obj:(vtable for std::runtime_error (.local))

ld.lld: error: relocation R_X86_64_PC32 cannot be used against symbol 'std::runtime_error::~runtime_error()'; recompile with -fPIC
>>> defined in libcxxabi/src/CMakeFiles/cxxabi_shared_objects.dir/stdlib_stdexcept.cpp.obj
>>> referenced by stdlib_stdexcept.cpp
>>>               libcxxabi/src/CMakeFiles/cxxabi_shared_objects.dir/stdlib_stdexcept.cpp.obj:(vtable for std::runtime_error (.local))

ld.lld: error: relocation R_X86_64_PC32 cannot be used against symbol 'std::runtime_error::what() const'; recompile with -fPIC
>>> defined in libcxxabi/src/CMakeFiles/cxxabi_shared_objects.dir/stdlib_stdexcept.cpp.obj
>>> referenced by stdlib_stdexcept.cpp
>>>               libcxxabi/src/CMakeFiles/cxxabi_shared_objects.dir/stdlib_stdexcept.cpp.obj:(vtable for std::runtime_error (.local))

ld.lld: error: relocation R_X86_64_PC32 cannot be used against symbol 'std::logic_error::~logic_error()'; recompile with -fPIC
>>> defined in libcxxabi/src/CMakeFiles/cxxabi_shared_objects.dir/stdlib_stdexcept.cpp.obj
>>> referenced by stdlib_stdexcept.cpp
>>>               libcxxabi/src/CMakeFiles/cxxabi_shared_objects.dir/stdlib_stdexcept.cpp.obj:(vtable for std::domain_error (.local))

Fuchsia uses C++ relative vtables by default so it looks like this is still being used. @PiJoules is familiar with the implementation of relative vtables and should be able to help with debugging.

Would it be possible to revert this change in the meantime?

petrhosek added a commit that referenced this pull request Apr 1, 2025
llvm-sync bot pushed a commit to arm/arm-toolchain that referenced this pull request Apr 1, 2025
@PiJoules
Copy link
Contributor

PiJoules commented Apr 1, 2025

It's correct that that lowerRelativeReference shouldn't be needed since all functions should have DSOLocalEquivalent wrapping them when referenced in the vtable. The linker error pops up because the PLT entry for the vtable component isn't used, just a direct reference but these symbols happen to be DEFAULT visible. The issue is in this snippet

      if (DSOEquiv && TM.getTargetTriple().isOSBinFormatELF() &&
          !(LHSGV->isDSOLocal() || LHSGV->isImplicitDSOLocal()))
        Res = getObjFileLowering().lowerDSOLocalEquivalent(
            LHSSym, RHSSym, Addend, PCRelativeOffset, TM);

specifically with the !(LHSGV->isDSOLocal() || LHSGV->isImplicitDSOLocal())). The symbols we see this popping up for have dso_local so the DSOLocalEquivalent isn't handled. The symbols are not hidden so the sub following this leads to the linker error since we're taking the offset of a DEFAULT symbol. Removing the !(LHSGV->isDSOLocal() || LHSGV->isImplicitDSOLocal()) part and unconditionally lowering DSOLocalEquivalent should work. Locally I can build the runtimes with this patch and removing this check.

Ankur-0429 pushed a commit to Ankur-0429/llvm-project that referenced this pull request Apr 2, 2025
@MaskRay
Copy link
Member Author

MaskRay commented Apr 8, 2025

It's correct that that lowerRelativeReference shouldn't be needed since all functions should have DSOLocalEquivalent wrapping them when referenced in the vtable. The linker error pops up because the PLT entry for the vtable component isn't used, just a direct reference but these symbols happen to be DEFAULT visible. The issue is in this snippet

      if (DSOEquiv && TM.getTargetTriple().isOSBinFormatELF() &&
          !(LHSGV->isDSOLocal() || LHSGV->isImplicitDSOLocal()))
        Res = getObjFileLowering().lowerDSOLocalEquivalent(
            LHSSym, RHSSym, Addend, PCRelativeOffset, TM);

specifically with the !(LHSGV->isDSOLocal() || LHSGV->isImplicitDSOLocal())). The symbols we see this popping up for have dso_local so the DSOLocalEquivalent isn't handled. The symbols are not hidden so the sub following this leads to the linker error since we're taking the offset of a DEFAULT symbol. Removing the !(LHSGV->isDSOLocal() || LHSGV->isImplicitDSOLocal()) part and unconditionally lowering DSOLocalEquivalent should work. Locally I can build the runtimes with this patch and removing this check.

Thanks! I forgot adjusting the code even if I added the comment ;; Create a PC-relative relocation that the linker might decline if the addend symbol is preemptible. :) Sent #134781

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants