aboutsummaryrefslogtreecommitdiff
path: root/bfd
diff options
context:
space:
mode:
Diffstat (limited to 'bfd')
-rw-r--r--bfd/bfd-in2.h1
-rw-r--r--bfd/bpf-reloc.def15
-rw-r--r--bfd/elf64-bpf.c2
-rw-r--r--bfd/libbfd.h1
-rw-r--r--bfd/reloc.c2
5 files changed, 21 insertions, 0 deletions
diff --git a/bfd/bfd-in2.h b/bfd/bfd-in2.h
index 1b9a801..ba7440c 100644
--- a/bfd/bfd-in2.h
+++ b/bfd/bfd-in2.h
@@ -7148,6 +7148,7 @@ assembler and not (currently) written to any object files. */
/* Linux eBPF relocations. */
BFD_RELOC_BPF_64,
BFD_RELOC_BPF_DISP32,
+ BFD_RELOC_BPF_DISP16,
/* Adapteva EPIPHANY - 8 bit signed pc-relative displacement */
BFD_RELOC_EPIPHANY_SIMM8,
diff --git a/bfd/bpf-reloc.def b/bfd/bpf-reloc.def
index b1be2eb..31f761d 100644
--- a/bfd/bpf-reloc.def
+++ b/bfd/bpf-reloc.def
@@ -72,3 +72,18 @@
0xffffffff, /* src_mask */
0xffffffff, /* dst_mask */
true) /* pcrel_offset */
+
+ /* 16-bit PC-relative address in load instructions. */
+ BPF_HOWTO (R_BPF_GNU_64_16, /* type */
+ 0, /* rightshift */
+ 2, /* size */
+ 16, /* bitsize */
+ true, /* pc_relative */
+ 16, /* bitpos */
+ complain_overflow_signed, /* complain_on_overflow */
+ bpf_elf_generic_reloc, /* special_function */
+ "R_BPF_GNU_64_16", /* name */
+ true, /* partial_inplace */
+ 0xffff, /* src_mask */
+ 0xffff, /* dst_mask */
+ true) /* pcrel_offset */
diff --git a/bfd/elf64-bpf.c b/bfd/elf64-bpf.c
index 65418d1..23ede4e 100644
--- a/bfd/elf64-bpf.c
+++ b/bfd/elf64-bpf.c
@@ -89,6 +89,8 @@ bpf_reloc_type_lookup (bfd * abfd ATTRIBUTE_UNUSED,
return &bpf_elf_howto_table[ (int) R_BPF_64_64_IDX];
case BFD_RELOC_BPF_DISP32:
return &bpf_elf_howto_table[ (int) R_BPF_64_32_IDX];
+ case BFD_RELOC_BPF_DISP16:
+ return &bpf_elf_howto_table[ (int) R_BPF_GNU_64_16_IDX];
default:
/* Pacify gcc -Wall. */
diff --git a/bfd/libbfd.h b/bfd/libbfd.h
index d4fb310..5dbb087 100644
--- a/bfd/libbfd.h
+++ b/bfd/libbfd.h
@@ -3346,6 +3346,7 @@ static const char *const bfd_reloc_code_real_names[] = { "@@uninitialized@@",
"BFD_RELOC_TILEGX_IMM8_Y1_TLS_ADD",
"BFD_RELOC_BPF_64",
"BFD_RELOC_BPF_DISP32",
+ "BFD_RELOC_BPF_DISP16",
"BFD_RELOC_EPIPHANY_SIMM8",
"BFD_RELOC_EPIPHANY_SIMM24",
"BFD_RELOC_EPIPHANY_HIGH",
diff --git a/bfd/reloc.c b/bfd/reloc.c
index fbc67ac..e71a510 100644
--- a/bfd/reloc.c
+++ b/bfd/reloc.c
@@ -7753,6 +7753,8 @@ ENUM
BFD_RELOC_BPF_64
ENUMX
BFD_RELOC_BPF_DISP32
+ENUMX
+ BFD_RELOC_BPF_DISP16
ENUMDOC
Linux eBPF relocations.