https://github.com/4ast requested changes to this pull request.

tbh the whole relocatable enums is starting to feel like a big can of worms.
See inline comments for tradeoff and the main concern...

A missing enumerator is normal for the enums that need the relocation. Take 
`enum cgroup_subsys_id`. Its values shift because Kconfig removes enumerators.

```c
  switch (ssid) {
  case memory_cgrp_id:
    return 1;
  case hugetlb_cgrp_id:
    return 2;
  }
```

A kernel without `CONFIG_CGROUP_HUGETLB` has no `hugetlb_cgrp_id`. libbpf 
poisons the `ld_imm64` for that label, so the verifier rejects the whole prog. 
`-fbpf-no-enum-reloc=` cannot be used, since this enum actually needs the 
relocation.

Not sure what is the solution.

https://github.com/llvm/llvm-project/pull/243338
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to