[all-commits] [llvm/llvm-project] 7f275e: [ELF][LTO] Add baseline test for invalid relocatio...

Alexander Richardson via All-commits all-commits at lists.llvm.org
Tue Feb 18 12:00:44 PST 2025


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 7f275e09a788412414e23e32dd3767ec92595cad
      https://github.com/llvm/llvm-project/commit/7f275e09a788412414e23e32dd3767ec92595cad
  Author: Alexander Richardson <alexrichardson at google.com>
  Date:   2025-02-18 (Tue, 18 Feb 2025)

  Changed paths:
    A lld/test/ELF/lto/arm-rtlibcall.ll

  Log Message:
  -----------
  [ELF][LTO] Add baseline test for invalid relocations against runtime calls

This can happen when using a LTO build of compiler-rt for ARM and the
program uses 64-bit division.
The 64-bit division function in compiler-rt (__aeabi_ldivmod) is written
in assembly and calls the C function __divmoddi4, which works fine in
non-LTO links. However, when building with LTO the call inside
__aeabi_ldivmod is replaced with a jump to address zero, which then
crashes the program.

Building with -pie generates an error instead of a jump to address zero,
and surprisingly just declaring the __aeabi_ldivmod function (but not
calling it) in the input IR also avoids this issue.

Reported as https://github.com/llvm/llvm-project/issues/127284

Co-authored-by: Fangrui Song <i at maskray.me>

Reviewed By: MaskRay

Pull Request: https://github.com/llvm/llvm-project/pull/127286



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