[all-commits] [llvm/llvm-project] 3cde1d: [ELF] Handle relocations in synthetic .eh_frame wi...

simpal01 via All-commits all-commits at lists.llvm.org
Tue Oct 3 02:20:27 PDT 2023


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 3cde1d8000e177409b220cea0d1f7250ab1b75d6
      https://github.com/llvm/llvm-project/commit/3cde1d8000e177409b220cea0d1f7250ab1b75d6
  Author: simpal01 <55694978+simpal01 at users.noreply.github.com>
  Date:   2023-10-03 (Tue, 03 Oct 2023)

  Changed paths:
    M lld/ELF/Arch/AArch64.cpp
    M lld/ELF/Arch/PPC64.cpp
    M lld/ELF/Arch/X86_64.cpp
    M lld/ELF/SyntheticSections.cpp
    M lld/ELF/Target.cpp
    A lld/test/ELF/eh-frame-nonzero-offset-aarch64.s
    A lld/test/ELF/eh-frame-nonzero-offset-arm.s
    A lld/test/ELF/eh-frame-nonzero-offset-ppc.s
    A lld/test/ELF/eh-frame-nonzero-offset-x86.s

  Log Message:
  -----------
  [ELF] Handle relocations in synthetic .eh_frame with a non-zero offset within the output section (#65966)

When the .eh_frame section is placed at a non-zero
offset within its output section, the relocation
value within .eh_frame are computed incorrectly.

We had similar issue in .ARM.exidx section and it has been
fixed already in https://reviews.llvm.org/D148033.

While applying the relocation using S+A-P,  the value
 of P (the location of the relocation) is getting wrong. 
P is:
  P = SecAddr + rel.offset, But SecAddr points to the
starting address of the outputsection rather than the
starting address of the eh frame section within that
output section.

This issue affects all targets which generates .eh_frame 
section. Hence fixing in all the corresponding targets it affecting.




More information about the All-commits mailing list