diff options
author | Guillermo E. Martinez <guillermo.e.martinez@oracle.com> | 2023-02-03 11:17:49 -0600 |
---|---|---|
committer | Guillermo E. Martinez <guillermo.e.martinez@oracle.com> | 2023-02-03 11:18:50 -0600 |
commit | 7f6ebecd56e690012b05af0a492280765b17f186 (patch) | |
tree | 64dad324277f2a48ec5ed43bcb556261e08b03ed /cpu | |
parent | 5a19bfd673d88184b5426b732178042ec24b248d (diff) | |
download | gdb-7f6ebecd56e690012b05af0a492280765b17f186.zip gdb-7f6ebecd56e690012b05af0a492280765b17f186.tar.gz gdb-7f6ebecd56e690012b05af0a492280765b17f186.tar.bz2 |
bpf: fix error conversion from long unsigned int to unsigned int [-Werror=overflow]
Regenerating BPF target using the maintainer mode emits:
.../opcodes/bpf-opc.c:57:11: error: conversion from ‘long unsigned int’ to ‘unsigned int’ changes value from ‘18446744073709486335’ to ‘4294902015’ [-Werror=overflow]
57 | 64, 64, 0xffffffffffff00ff, { { F (F_IMM32) }, { F (F_OFFSET16) }, { F (F_SRCLE) }, { F (F_OP_CODE) }, { F (F_DSTLE) }, { F (F_OP_SRC) }, { F (F_OP_CLASS) }, { 0 } }
The use of a narrow size to handle the mask CGEN in instruction format
is causing this error. Additionally eBPF `call' instructions
constructed by expressions using symbols (BPF_PSEUDO_CALL) emits
annotations in `src' field of the instruction, used to identify BPF
target endianness.
cpu/
* bpf.cpu (define-call-insn): Remove `src' field from
instruction mask.
include/
*opcode/cge.h (CGEN_IFMT): Adjust mask bit width.
opcodes/
* bpf-opc.c: Regenerate.
Diffstat (limited to 'cpu')
-rw-r--r-- | cpu/bpf.cpu | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/cpu/bpf.cpu b/cpu/bpf.cpu index 13dde70..2ae74fc 100644 --- a/cpu/bpf.cpu +++ b/cpu/bpf.cpu @@ -768,7 +768,7 @@ "call" (endian-isas x-endian) "call $disp32" - (+ disp32 (f-offset16 0) (f-regs 0) + (+ disp32 (f-offset16 0) (.sym src x-endian) ((.sym f-dst x-endian) 0) OP_CLASS_JMP OP_SRC_K OP_CODE_CALL) (c-call VOID "bpfbf_call" disp32 (ifield (.sym f-src x-endian))) |