mirror of
https://github.com/espressif/binutils-gdb.git
synced 2025-09-09 21:22:20 +08:00
bpf: fix false overflow in eBPF ELF backend linker
When performing DISP{16,32} relocations, the eBPF ELF backend linker needs to convert the relocation from an address into a signed number of 64-bit words (minus one) to jump. Because of this unsigned-to-signed conversion, special care needs to be taken when dividing to ensure the sign bits remain correct. Otherwise, a false relocation overflow error can be triggered. bfd/ChangeLog 2020-08-07 David Faust <david.faust@oracle.com> * elf64-bpf.c (bpf_elf_relocate_section): Ensure signed division for DISP16 and DISP32 relocations. ld/ChangeLog 2020-08-07 David Faust <david.faust@oracle.com> * testsuite/ld-bpf/call-3.s: New file. * testsuite/ld-bpf/call-3.d: Likewise.
This commit is contained in:

committed by
Jose E. Marchesi

parent
fe4c3d430b
commit
d844f10ac2
@ -1,3 +1,8 @@
|
||||
2020-08-07 David Faust <david.faust@oracle.com>
|
||||
|
||||
* testsuite/ld-bpf/call-3.s: New file.
|
||||
* testsuite/ld-bpf/call-3.d: Likewise.
|
||||
|
||||
2020-08-05 David Faust <david.faust@oracle.com>
|
||||
|
||||
* testsuite/ld-bpf/call-2.s: New file.
|
||||
|
Reference in New Issue
Block a user