[all-commits] [llvm/llvm-project] 767e64: [ELF] Support some absolute/PC-relative relocation...

Fangrui Song via All-commits all-commits at lists.llvm.org
Fri Feb 25 11:25:30 PST 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 767e64fc11d7734843ec5bb0bd3f7330541bb1a6
      https://github.com/llvm/llvm-project/commit/767e64fc11d7734843ec5bb0bd3f7330541bb1a6
  Author: Fangrui Song <i at maskray.me>
  Date:   2022-02-25 (Fri, 25 Feb 2022)

  Changed paths:
    M lld/ELF/Arch/AArch64.cpp
    M lld/ELF/Arch/PPC.cpp
    M lld/ELF/Arch/PPC64.cpp
    A lld/test/ELF/relocation-rel-format.test

  Log Message:
  -----------
  [ELF] Support some absolute/PC-relative relocation types for REL format

ctfconvert seems to use REL-format `.rel.SUNW_dof` for 32-bit architectures.
```
Binary file usr/ports/lang/perl5.32/work/perl-5.32.1/dtrace_mini.o matches
[alfredo.junior at dell-a ~/tmp/llvm-bug]$ readelf -r dtrace_mini.o

Relocation section (.rel.SUNW_dof):
r_offset r_info   r_type              st_value st_name
00000184 0000281a R_PPC_REL32         00000000 $dtrace1772974259.Perl_dtrace_probe_load
```

Support R_PPC_REL32 to fix `ld.lld: error: drti.c:(.SUNW_dof+0x4E4): internal linker error: cannot read addend for relocation R_PPC_REL32`.
While here, add some common relocation types for AArch64, PPC, and PPC64.
We perform minimum tests.

Reviewed By: adalava, arichardson

Differential Revision: https://reviews.llvm.org/D120535




More information about the All-commits mailing list