This is the mail archive of the
gdb-testers@sourceware.org
mailing list for the GDB project.
[binutils-gdb] RISC-V: Add R_RISCV_DELETE, which marks bytes for deletion
- From: sergiodj+buildbot at sergiodj dot net
- To: gdb-testers at sourceware dot org
- Date: Thu, 19 Oct 2017 12:35:42 -0400
- Subject: [binutils-gdb] RISC-V: Add R_RISCV_DELETE, which marks bytes for deletion
- Authentication-results: sourceware.org; auth=none
*** TEST RESULTS FOR COMMIT ff6f4d9b2d6c25ac144bab869df6e3d6123a6f8f ***
Author: Palmer Dabbelt <palmer@dabbelt.com>
Branch: master
Commit: ff6f4d9b2d6c25ac144bab869df6e3d6123a6f8f
RISC-V: Add R_RISCV_DELETE, which marks bytes for deletion
We currently delete bytes by shifting an entire BFD backwards to
overwrite the bytes we no longer need. The result is that relaxing a
BFD is quadratic time.
This patch adds an additional relocation that specifies a byte range
that will be deleted from the final object file, and adds a relaxation
pass (between the existing passes that delete bytes and the alignment
pass) that actually deletes the bytes. Note that deletion is still
quadratic time, and nothing uses R_RISCV_DELETE yet.
I've been meaning to go convert all the other relaxations to use
R_RISCV_DELETE and then make it faster, but this patch has been sitting
around for months so it looks like that won't happen for a bit. The
PCREL->GPREL relaxation that comes next uses this, and since we've been
using these two patches out of tree since I wrote them months ago I
figure it's better to just get them in now. I (or someone else :)) can
convert all the relocations later...
R_RISCV_DELETE will never be emitted into ELF objects, so therefor isn't
exposed to the rest of binutils. As such, we're not considering this as
part of the ABI.
bfd/ChangeLog
2017-10-19 Palmer Dabbelt <palmer@dabbelt.com>
* elfnn-riscv (R_RISCV_DELETE): New define.
(_bfd_riscv_relax_delete): New function.
(perform_relocation): Handle R_RISCV_DELETE.
(_bfd_riscv_relax_section): Likewise.
ld/ChangeLog
2017-10-19 Palmer Dabbelt <palmer@dabbelt.com>
* emultempl/riscvelf.em (riscv_elf_before_allocation): Add a
third relaxation pass.
- Follow-Ups:
- *** COMPILATION FAILED *** Failures on Ubuntu-AArch64-native-gdbserver-m64, branch master *** BREAKAGE ***
- *** COMPILATION FAILED *** Failures on Ubuntu-AArch64-m64, branch master *** BREAKAGE ***
- *** COMPILATION FAILED *** Failures on Ubuntu-AArch32-m32, branch master *** BREAKAGE ***
- *** COMPILATION FAILED *** Failures on Ubuntu-AArch32-native-extended-gdbserver-m32, branch master *** BREAKAGE ***
- *** COMPILATION FAILED *** Failures on Ubuntu-AArch32-native-gdbserver-m32, branch master *** BREAKAGE ***
- Failures on Fedora-x86_64-m64, branch master
- Failures on Fedora-x86_64-native-gdbserver-m32, branch master
- Failures on Fedora-x86_64-native-extended-gdbserver-m64, branch master
- Failures on Fedora-x86_64-cc-with-index, branch master
- Failures on Fedora-i686, branch master
- Failures on Fedora-x86_64-m32, branch master
- Failures on Fedora-x86_64-native-extended-gdbserver-m32, branch master