]> gcc.gnu.org Git - gcc.git/commit
bpf: handle anonymous members in CO-RE reloc [PR106745]
authorDavid Faust <david.faust@oracle.com>
Mon, 29 Aug 2022 18:21:52 +0000 (11:21 -0700)
committerDavid Faust <david.faust@oracle.com>
Mon, 29 Aug 2022 20:45:47 +0000 (13:45 -0700)
commitb504149d2c92ddfcfab62ea6d1ed49ae72493e38
tree1e3fd59944faf25342b64c82e0621dcf90df7540
parentc68b5c078bbf167e6ab84fc230a53580dcc651db
bpf: handle anonymous members in CO-RE reloc [PR106745]

The old method for computing a member index for a CO-RE relocation
relied on a name comparison, which could SEGV if the member in question
is itself part of an anonymous inner struct or union.

This patch changes the index computation to not rely on a name, while
maintaining the ability to account for other sibling fields which may
not have a representation in BTF.

gcc/ChangeLog:

PR target/106745
* config/bpf/coreout.cc (bpf_core_get_sou_member_index): Fix
computation of index for anonymous members.

gcc/testsuite/ChangeLog:

PR target/106745
* gcc.target/bpf/core-pr106745.c: New test.
gcc/config/bpf/coreout.cc
gcc/testsuite/gcc.target/bpf/core-pr106745.c [new file with mode: 0644]
This page took 0.057102 seconds and 5 git commands to generate.