[Bug target/107848] libbpf: ELF relo #0 in section #7 has unexpected type 12

2023-03-22 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107848

Andrew Pinski  changed:

   What|Removed |Added

 Resolution|FIXED   |MOVED

--- Comment #4 from Andrew Pinski  ---
.

[Bug target/107848] libbpf: ELF relo #0 in section #7 has unexpected type 12

2023-03-22 Thread jemarch at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107848

Jose E. Marchesi  changed:

   What|Removed |Added

 Status|UNCONFIRMED |RESOLVED
 Resolution|--- |FIXED

--- Comment #3 from Jose E. Marchesi  ---
This was due to a binutils bug.  Fixed by the following binutils upstream
commits:

commit 5f784ec9277e9303eee3ce366c40ce9fa3203f3e
Author: Cupertino Miranda 
Date:   Fri Mar 17 15:29:36 2023 +

Changed ld and gas BPF tests

Recent BPF patch removed and renamed the list of relocations based on
the limitations of BPF instruction set.
This patch is a correction to the tests.

commit 551fde0ae1691a74e1fdfb2bd33e8453106c0c87
Author: Cupertino Miranda 
Date:   Fri Mar 17 15:27:02 2023 +

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.

commit 5e4c7a839d1c0d68a4a518cf2dc8e87925575e58
Author: Cupertino Miranda 
Date:   Thu Mar 16 08:39:52 2023 +

BPF relocations review / refactoring

- Removed not needed relocations.
- Renamed relocations to match llvm and linux kernel.

Relocation changes:
  R_BPF_INSN_64 => R_BPF_64_64
  R_BPF_INSN_DISP32 => R_BPF_64_32
  R_BPF_DATA_32 => R_BPF_64_ABS32
  R_BPF_DATA_64 => R_BPF_64_ABS64

[Bug target/107848] libbpf: ELF relo #0 in section #7 has unexpected type 12

2022-11-23 Thread jose.marchesi at oracle dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107848

--- Comment #2 from Jose E. Marchesi  ---
This is likely due to the fact they added new BPF relocations:

  https://reviews.llvm.org/D102712

Or course not bothering telling us.

[Bug target/107848] libbpf: ELF relo #0 in section #7 has unexpected type 12

2022-11-23 Thread james.hilliard1 at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107848

--- Comment #1 from James Hilliard  ---
Working LLVM BTF Dump:
$ /home/buildroot/bpf-next/tools/testing/selftests/bpf/tools/sbin/bpftool
--debug btf dump file
/home/buildroot/bpf-next/tools/testing/selftests/bpf/bpf_dctcp_release.bpf.o
format raw
[1] PTR '(anon)' type_id=2
[2] INT 'unsigned long long' size=8 bits_offset=0 nr_bits=64 encoding=(none)
[3] FUNC_PROTO '(anon)' ret_type_id=0 vlen=1
'ctx' type_id=1
[4] FUNC 'dctcp_nouse_release' type_id=3 linkage=global
[5] INT 'char' size=1 bits_offset=0 nr_bits=8 encoding=SIGNED
[6] ARRAY '(anon)' type_id=5 index_type_id=7 nr_elems=4
[7] INT '__ARRAY_SIZE_TYPE__' size=4 bits_offset=0 nr_bits=32 encoding=(none)
[8] VAR '_license' type_id=6, linkage=global
[9] CONST '(anon)' type_id=5
[10] ARRAY '(anon)' type_id=9 index_type_id=7 nr_elems=6
[11] VAR 'cubic' type_id=10, linkage=global
[12] STRUCT 'tcp_congestion_ops' size=128 vlen=15
'name' type_id=13 bits_offset=0
'flags' type_id=14 bits_offset=128
'init' type_id=16 bits_offset=192
'release' type_id=16 bits_offset=256
'ssthresh' type_id=25 bits_offset=320
'cong_avoid' type_id=27 bits_offset=384
'set_state' type_id=29 bits_offset=448
'cwnd_event' type_id=32 bits_offset=512
'in_ack_event' type_id=35 bits_offset=576
'undo_cwnd' type_id=25 bits_offset=640
'pkts_acked' type_id=37 bits_offset=704
'min_tso_segs' type_id=25 bits_offset=768
'sndbuf_expand' type_id=25 bits_offset=832
'cong_control' type_id=44 bits_offset=896
'owner' type_id=52 bits_offset=960
[13] ARRAY '(anon)' type_id=5 index_type_id=7 nr_elems=16
[14] TYPEDEF '__u32' type_id=15
[15] INT 'unsigned int' size=4 bits_offset=0 nr_bits=32 encoding=(none)
[16] PTR '(anon)' type_id=17
[17] FUNC_PROTO '(anon)' ret_type_id=0 vlen=1
'(anon)' type_id=18
[18] PTR '(anon)' type_id=19
[19] STRUCT 'sock' size=24 vlen=3
'__sk_common' type_id=20 bits_offset=0
'sk_pacing_rate' type_id=24 bits_offset=64
'sk_pacing_status' type_id=14 bits_offset=128
[20] STRUCT 'sock_common' size=4 vlen=2
'skc_state' type_id=21 bits_offset=0
'skc_num' type_id=22 bits_offset=16
[21] INT 'unsigned char' size=1 bits_offset=0 nr_bits=8 encoding=(none)
[22] TYPEDEF '__u16' type_id=23
[23] INT 'unsigned short' size=2 bits_offset=0 nr_bits=16 encoding=(none)
[24] INT 'unsigned long' size=8 bits_offset=0 nr_bits=64 encoding=(none)
[25] PTR '(anon)' type_id=26
[26] FUNC_PROTO '(anon)' ret_type_id=14 vlen=1
'(anon)' type_id=18
[27] PTR '(anon)' type_id=28
[28] FUNC_PROTO '(anon)' ret_type_id=0 vlen=3
'(anon)' type_id=18
'(anon)' type_id=14
'(anon)' type_id=14
[29] PTR '(anon)' type_id=30
[30] FUNC_PROTO '(anon)' ret_type_id=0 vlen=2
'(anon)' type_id=18
'(anon)' type_id=31
[31] TYPEDEF '__u8' type_id=21
[32] PTR '(anon)' type_id=33
[33] FUNC_PROTO '(anon)' ret_type_id=0 vlen=2
'(anon)' type_id=18
'(anon)' type_id=34
[34] ENUM 'tcp_ca_event' encoding=UNSIGNED size=4 vlen=6
'CA_EVENT_TX_START' val=0
'CA_EVENT_CWND_RESTART' val=1
'CA_EVENT_COMPLETE_CWR' val=2
'CA_EVENT_LOSS' val=3
'CA_EVENT_ECN_NO_CE' val=4
'CA_EVENT_ECN_IS_CE' val=5
[35] PTR '(anon)' type_id=36
[36] FUNC_PROTO '(anon)' ret_type_id=0 vlen=2
'(anon)' type_id=18
'(anon)' type_id=14
[37] PTR '(anon)' type_id=38
[38] FUNC_PROTO '(anon)' ret_type_id=0 vlen=2
'(anon)' type_id=18
'(anon)' type_id=39
[39] PTR '(anon)' type_id=40
[40] CONST '(anon)' type_id=41
[41] STRUCT 'ack_sample' size=12 vlen=3
'pkts_acked' type_id=14 bits_offset=0
'rtt_us' type_id=42 bits_offset=32
'in_flight' type_id=14 bits_offset=64
[42] TYPEDEF '__s32' type_id=43
[43] INT 'int' size=4 bits_offset=0 nr_bits=32 encoding=SIGNED
[44] PTR '(anon)' type_id=45
[45] FUNC_PROTO '(anon)' ret_type_id=0 vlen=2
'(anon)' type_id=18
'(anon)' type_id=46
[46] PTR '(anon)' type_id=47
[47] CONST '(anon)' type_id=48
[48] STRUCT 'rate_sample' size=56 vlen=13
'prior_mstamp' type_id=49 bits_offset=0
'prior_delivered' type_id=14 bits_offset=64
'delivered' type_id=42 bits_offset=96
'interval_us' type_id=50 bits_offset=128
'snd_interval_us' type_id=14 bits_offset=192
'rcv_interval_us' type_id=14 bits_offset=224
'rtt_us' type_id=50 bits_offset=256
'losses' type_id=43 bits_offset=320
'acked_sacked' type_id=14 bits_offset=352
'prior_in_flight' type_id=14 bits_offset=384
'is_app_limited' type_id=51 bits_offset=416
'is_retrans' type_id=51 bits_offset=424
'is_ack_delayed' type_id=51 bits_offset=432
[49] TYPEDEF '__u64' type_id=2
[50] INT 'long' size=8 bits_offset=0 nr_bits=64 encoding=SIGNED
[51] INT '_Bool' size=1 bits_offset=0 nr_bits=8 encoding=BOOL
[52] PTR '(anon)' type_id=0
[53] VAR