Re: Compute correct mask and values when offset in define-ifield is not 0
"Guillermo E. Martinez via Cgen" <[email protected]> Fri, 6 Jan 2023 01:59:39 -0600
| Newsgroups | gmane.comp.tools.cgen.devel,gmane.comp.gnu.binutils |
|---|---|
| Message-ID | <20230106075939.jxsf32av4bzysyqo@kamehouse> |
Hello Alan,
On Fri, Jan 06, 2023 at 11:22:55AM +1030, Alan Modra wrote:
> Updating the copyright dates this year reminded me that I have a cgen
> patch of yours, commit d1dd5fcc38ea, reverted in order to build
> binutils. Without the reversion there are 10 or so errors like
> .../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 } }
> | ^~~~~~~~~~~~~~~~~~
>
> What's more, if I build with --disable-werror, then the following
> testsuite fails show up:
> gas/
> +FAIL: eBPF CALL instruction
> +FAIL: eBPF CALL instruction, big endian
Ooh, sorry for inconvenience. This is because CGEN patch (d1dd5fcc38ea)
revealed an disassemble error in binutils for eBPF `call' instructions
constructed by expressions using symbols (BPF_PSEUDO_CALL), and the use of
a wrong size type to handle the mask CGEN instruction format.
I posted a patch to fix it:
https://sourceware.org/pipermail/binutils/2023-January/125517.html
> ld/
> +FAIL: CALL with disp32 reloc
> +FAIL: CALL with disp32 reloc and addend
> +FAIL: CALL check unsigned underflow
>
> All caused by failure of call insns to disassemble with your patch
> applied. Please fix, or revert in the cgen sources.
>
> --
> Alan Modra
> Australia Development Lab, IBM
Apologies and Kind regards,
guillermo