[all-commits] [llvm/llvm-project] 336f87: [LoongArch] Fix GOT usage for `non-dso_local` func...

wanglei via All-commits all-commits at lists.llvm.org
Mon Nov 25 00:45:28 PST 2024


  Branch: refs/heads/release/19.x
  Home:   https://github.com/llvm/llvm-project
  Commit: 336f87753b510aed840daf87f8d3a4996e6c8f15
      https://github.com/llvm/llvm-project/commit/336f87753b510aed840daf87f8d3a4996e6c8f15
  Author: wanglei <wanglei at loongson.cn>
  Date:   2024-11-25 (Mon, 25 Nov 2024)

  Changed paths:
    M llvm/lib/Target/LoongArch/LoongArchExpandPseudoInsts.cpp
    M llvm/test/CodeGen/LoongArch/code-models.ll
    M llvm/test/CodeGen/LoongArch/machinelicm-address-pseudos.ll
    M llvm/test/CodeGen/LoongArch/psabi-restricted-scheduling.ll
    M llvm/test/CodeGen/LoongArch/tls-models.ll

  Log Message:
  -----------
  [LoongArch] Fix GOT usage for `non-dso_local` function calls in large code model

This commit fixes an issue in the large code model where non-dso_local
function calls did not use the GOT as expected in PIC mode. Instead,
direct PC-relative access was incorrectly applied, leading to linker
errors when building shared libraries.

For `ExternalSymbol`, it is not possible to determine whether it is
dso_local during pseudo-instruction expansion. We use target flags to
differentiate whether GOT should be used.

Cherry-picked from #117099, used for fix linker errors when bulding
shared libraries with large code model.



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list