Skip to content
Snippets Groups Projects
Commit ede01dfd authored by Cupertino Miranda's avatar Cupertino Miranda
Browse files

bpf: remove huge memory waste with string allocation.

The BPF backend was allocating an unnecessarily large string when
constructing CO-RE relocations for enum types.
This patch also verifies that those enumerators are valid for CO-RE,
returning an error otherwise.

gcc/ChangeLog:
	* config/bpf/core-builtins.cc (get_index_for_enum_value): Create
	function.
	(pack_enum_value): Check for enumerator and error out.
	(process_enum_value): Correct string allocation.
parent d7190d0b
No related branches found
No related tags found
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment