bpf: write CO-RE relocation record size only once
authorDavid Faust <david.faust@oracle.com>
Tue, 14 Dec 2021 20:41:30 +0000 (12:41 -0800)
committerDavid Faust <david.faust@oracle.com>
Tue, 18 Jan 2022 21:20:49 +0000 (13:20 -0800)
commit43ec2652134239f83cd4c06bc4d8158acc0721cf
tree4abae0ea73485d9c1a66c157d25ba02822e8b95d
parent2aefe248aa4160205c44808166393a42031d2dea
bpf: write CO-RE relocation record size only once

The CO-RE relocation record size should be written only once in the
.BTF.ext section, not once for each section with relocations.

gcc/ChangeLog:

* config/bpf/coreout.cc (output_btfext_header): Account for
4-byte record size in core_relo_len.
(output_btfext_core_sections): Only write record size once.
* config/bpf/coreout.h (btf_ext_section_header): Delete unused
member.

gcc/testsuite/ChangeLog:

* gcc.target/bpf/core-section-1.c: Adjust expected record size
occurrences.
gcc/config/bpf/coreout.cc
gcc/config/bpf/coreout.h
gcc/testsuite/gcc.target/bpf/core-section-1.c