You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I don't know if that is a limitation of the eBPF instruction set or a limitation of the ubpf virtual machine but seems that is not possible to load programs that use external functions that have arguments type char *. Clang can compile the programs correctly but when loaded the ubp_load_elf functions exits with the error: Fialed to load code: bad relocation type.
If it is not a limitation of the eBPF instruction set I could try to look into it.
The text was updated successfully, but these errors were encountered:
RELOCATION RECORDS FOR [.text]:
OFFSET TYPE VALUE
0000000000000000 UNKNOWN .L.str
0000000000000010 UNKNOWN .L.str.1
0000000000000020 UNKNOWN strcmp_ext
The relocation type is 1. This could mean "absolute 64-bit".
I guess then that the simplest way would be to just keep the loaded strings form the data segment stored somewhere in the vm struct and then reference them into the lddw instructions when relocating. But although this would work, I'm not sure this would be legal eBPF code as the verifier should not allow arbitrary pointers.
iovisor/bcc tools first write the strings into the stack and then the stack address pointing to the string is passed to the external function but this involves generating code and seems that they have modified Clang/LLVM to achieve this.
I don't know if that is a limitation of the eBPF instruction set or a limitation of the ubpf virtual machine but seems that is not possible to load programs that use external functions that have arguments type char *. Clang can compile the programs correctly but when loaded the ubp_load_elf functions exits with the error: Fialed to load code: bad relocation type.
If it is not a limitation of the eBPF instruction set I could try to look into it.
The text was updated successfully, but these errors were encountered: