bug-binutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Bug ld/24683] RISC-V call and callplt reloc handling


From: nelsonc1225 at sourceware dot org
Subject: [Bug ld/24683] RISC-V call and callplt reloc handling
Date: Tue, 06 Sep 2022 08:57:09 +0000

https://sourceware.org/bugzilla/show_bug.cgi?id=24683

Nelson Chu <nelsonc1225 at sourceware dot org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |nelsonc1225 at sourceware dot 
org
             Status|NEW                         |RESOLVED
         Resolution|---                         |FIXED

--- Comment #2 from Nelson Chu <nelsonc1225 at sourceware dot org> ---
Anyway, we should have the same behavior of CALL and CALL_PLT both in GNU and
LLVM, so marked this as RESOLVED and FIXED.

Btw, Psabi now suggest to use CALL_PLT, and deprecate CALL,
https://github.com/riscv-non-isa/riscv-elf-psabi-doc/commit/a0dced85018d7a0ec17023c9389cbd70b1dbc1b0

commit 3b1450b38c644f99aa2e211747b428b9f8d15cca
Refs: gdb-9-branchpoint-3394-g3b1450b38c6
Author:     Nelson Chu <nelson.chu@sifive.com>
AuthorDate: Wed Aug 26 01:19:13 2020 -0700
Commit:     Nelson Chu <nelson.chu@sifive.com>
CommitDate: Fri Aug 28 09:37:35 2020 +0800

    RISC-V: Treat R_RISCV_CALL and R_RISCV_CALL_PLT as the same in
check_relocs.

    In fact, we can treate these two relocation as the same one in the
    riscv_elf_check_relocs.  I have heard that RISC-V lld had made this
    improvement, and so had GNU AARCH64, they only need R_AARCH64_CALL26
    for calls rather than two seperate relocations.

    Beside, the following PLT issue for RISC-V 32-bit glibc seems to be
    fixed by applying at least this patch.

    <https://sourceware.org/pipermail/libc-alpha/2020-August/117214.html>

    I have ran the toolchain regression, and everything seems fine for now.

            bfd/
            * elfnn-riscv.c (riscv_elf_check_relocs): Treat R_RISCV_CALL
            and R_RISCV_CALL_PLT as the same in the riscv_elf_check_relocs.
            (riscv_elf_relocate_section): Remove the R_RISCV_CALL for the
            unresolved reloc checks.

            ld/
            testsuite/ld-riscv-elf/lib-nopic-01a.s: Use R_RISCV_JAL rather
            than R_RISCV_CALL.
            testsuite/ld-riscv-elf/lib-nopic-01b.d: Likewise.
            testsuite/ld-riscv-elf/lib-nopic-01b.s: Likewise.

-- 
You are receiving this mail because:
You are on the CC list for the bug.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]