bpf: avoid issues with CO-RE and -gtoggle

Compiling a BPF program with CO-RE relocations (and BTF) while also
passing -gtoggle led to an inconsistent state where CO-RE support was
enabled but BTF would not be generated, and this was not caught by the
existing option parsing.  This led to an ICE when generating the CO-RE
relocation info, since BTF is required for CO-RE.

Update bpf_option_override to avoid this case, and add a few tests for
the interactions of these options.

gcc/
	* config/bpf/bpf.cc (bpf_option_override): Improve handling of CO-RE
	options to avoid issues with -gtoggle.

gcc/testsuite/
	* gcc.target/bpf/core-options-1.c: New test.
	* gcc.target/bpf/core-options-2.c: Likewise.
	* gcc.target/bpf/core-options-3.c: Likewise.
4 files changed