aboutsummaryrefslogtreecommitdiff
path: root/bfd/elf64-bpf.c
diff options
context:
space:
mode:
authorCupertino Miranda <cupertino.miranda@oracle.com>2023-03-17 15:27:02 +0000
committerCupertino Miranda <cupertino.miranda@oracle.com>2023-03-20 15:35:21 +0000
commit551fde0ae1691a74e1fdfb2bd33e8453106c0c87 (patch)
treeda983ecb24e72370d78b2dfdffecddca7e1d8264 /bfd/elf64-bpf.c
parent6e7eef72164c00d6a5a7b0bce9fa01f5481f33cb (diff)
downloadgdb-551fde0ae1691a74e1fdfb2bd33e8453106c0c87.zip
gdb-551fde0ae1691a74e1fdfb2bd33e8453106c0c87.tar.gz
gdb-551fde0ae1691a74e1fdfb2bd33e8453106c0c87.tar.bz2
Reloc howto access broken for BPF
Forgot to change the logic to access the reloc howto from bpf_elf_relocate_section. Problem was introduced in previous BPF commit.
Diffstat (limited to 'bfd/elf64-bpf.c')
-rw-r--r--bfd/elf64-bpf.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/bfd/elf64-bpf.c b/bfd/elf64-bpf.c
index ef34d62..65418d1 100644
--- a/bfd/elf64-bpf.c
+++ b/bfd/elf64-bpf.c
@@ -190,6 +190,7 @@ bpf_elf_relocate_section (bfd *output_bfd ATTRIBUTE_UNUSED,
for (rel = relocs; rel < relend; rel ++)
{
reloc_howto_type * howto;
+ unsigned int howto_index;
unsigned long r_symndx;
Elf_Internal_Sym * sym;
asection * sec;
@@ -203,7 +204,9 @@ bpf_elf_relocate_section (bfd *output_bfd ATTRIBUTE_UNUSED,
r_type = ELF64_R_TYPE (rel->r_info);
r_symndx = ELF64_R_SYM (rel->r_info);
- howto = bpf_elf_howto_table + ELF64_R_TYPE (rel->r_info);
+
+ howto_index = bpf_index_for_rtype (ELF64_R_TYPE (rel->r_info));
+ howto = &bpf_elf_howto_table[howto_index];
h = NULL;
sym = NULL;
sec = NULL;