Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build issue: invalid relo against 'pid_to_hide' #12

Open
netspooky opened this issue Apr 29, 2022 · 1 comment
Open

Build issue: invalid relo against 'pid_to_hide' #12

netspooky opened this issue Apr 29, 2022 · 1 comment

Comments

@netspooky
Copy link

Hey there, I was trying to build this project on a fresh Ubuntu 20.04 install

I installed the following for the main dependencies:

  • linux-tools-common
  • linux-tools-5.13.0-40-generic
  • clang
  • llvm
  • gcc-multilib
  • the linux headers

For xdp tools: https://github.com/xdp-project/xdp-tools

  • m4
  • zlib1g
  • zlib1g-dev
  • libelf1
  • libelf-dev
  • libpcap-dev

I also installed libbpf from source: https://github.com/libbpf/libbpf

When I tried to run make, I got this error:

user@xb2004d2:~/git/boopkit-1.3.0$ make
bpftool btf dump file /sys/kernel/btf/vmlinux format c > vmlinux.h
  ->  Building pr0be.boop.o
clang -S \
    -target bpf \
    -D __BPF_TRACING__ \
    -I/usr/local/include \
    -Wall \
    -Werror \
    -O2 -emit-llvm -c -g pr0be.boop.c
llc -march=bpf -filetype=obj -o pr0be.boop.o pr0be.boop.ll
  ->  Building pr0be.safe.o
clang -S \
    -target bpf \
    -D __BPF_TRACING__ \
    -I/usr/local/include \
    -Wall \
    -Werror \
    -O2 -emit-llvm -c -g pr0be.safe.c
llc -march=bpf -filetype=obj -o pr0be.safe.o pr0be.safe.ll
  ->  Building pr0be.xdp.o
clang -S \
    -target bpf \
    -D __BPF_TRACING__ \
    -I/usr/local/include \
    -Wall \
    -Werror \
    -O2 -emit-llvm -c -g pr0be.xdp.c
llc -march=bpf -filetype=obj -o pr0be.xdp.o pr0be.xdp.ll
  ->  Building eBPF pr0bes
  ->  Generating pr0be.skel.safe.h
bpftool gen skeleton pr0be.safe.o -p > pr0be.skel.safe.h
libbpf: prog 'handle_getdents_exit': invalid relo against 'pid_to_hide' in special section 0xfff2; forgot to initialize global var?..
make: *** [Makefile:47: skeleton] Error 255

During this process I also noticed that a file named 'm'$'\177' appeared with the content stable\n, which makes me think there was an environment variable or something that I may have not properly set up. In any case, would love some guidance on what the possible solution might be. Thank you!

@opensesamedoors
Copy link

same issue on ubuntu 20

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants