bug-binutils
[Top][All Lists]
Advanced

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

[Bug binutils/30282] risc-v: objdump is really slow


From: cvs-commit at gcc dot gnu.org
Subject: [Bug binutils/30282] risc-v: objdump is really slow
Date: Tue, 18 Apr 2023 03:41:53 +0000

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

--- Comment #2 from cvs-commit at gcc dot gnu.org <cvs-commit at gcc dot 
gnu.org> ---
The master branch has been updated by Nelson Chu <nelsonc1225@sourceware.org>:

https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=c2f60ac565f1d369fde98146a16f1d3ef79e1000

commit c2f60ac565f1d369fde98146a16f1d3ef79e1000
Author: Kito Cheng <kito.cheng@sifive.com>
Date:   Mon Apr 17 20:16:33 2023 +0800

    RISC-V: Cache the latest mapping symbol and its boundary.

    This issue was reported from
https://github.com/riscv-collab/riscv-gnu-toolchain/issues/1188

    Current flow:
    1) Scan any mapping symbol less than this instruciton.
    2) If not found, did a backward search.

    The flow seems not big issue, let run an example here:

    $x:
    0x0 a   <--- Found at step 1
    0x4 b   <--- Not found in step 1, but found at step 2
    0x8 c   <--- Not found in step 1, but found at step 2
    $d
    0x12 .word 1234 <-- Found at step 1

    The instruciton didn't have the same address with mapping symbol will
    still did backward search again and again.

    So the new flow is:
    1) Use the last mapping symbol status if the address is still within the
range
       of the current mapping symbol.
    2) Scan any mapping symbol less than this instruciton.
    3) If not found, did a backward search.
    4) If a proper mapping symbol is found in either step 2 or 3, find its
boundary,
       and cache that.

    Use the same example to run the new flow again:

    $x:
    0x0 a   <--- Found at step 2, the boundary is 0x12
    0x4 b   <--- Cache hit at step 1, within the boundary.
    0x8 c   <--- Cache hit at step 1, within the boundary.
    $d
    0x12 .word 1234 <-- Found at step 2, the boundary is the end of section.

    The disassemble time of the test cases has been reduced from ~20 minutes to
~4
    seconds.

    opcode/ChangeLog
            PR 30282
            * riscv-dis.c (last_map_symbol_boundary): New.
            (last_map_state): New.
            (last_map_section): New.
            (riscv_search_mapping_symbol): Cache the result of latest
            mapping symbol.

-- 
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]