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

adding support for clang relocations #102

Closed
wants to merge 16 commits into from
Closed

Conversation

mdr78
Copy link

@mdr78 mdr78 commented Mar 22, 2022

Added support for clang function and string relocations, these show as up as
R_BPF_64_64 and R_BPF_64_32 in *-readelf relocations. Support for nosetests elf
tests is still TBD.

Signed-off-by: Ray Kinsella mdr@ashroe.eu

@Alan-Jowett
Copy link
Collaborator

@mdr78 Can you please add tests for this change?

@mdr78
Copy link
Author

mdr78 commented Apr 19, 2022

Ok will do, needs some tidyup in places also.

@Alan-Jowett
Copy link
Collaborator

Ok will do, needs some tidyup in places also.

Any update on this?

Matthew Gretton-Dann and others added 16 commits July 13, 2022 11:31
This patch separates out the JITter from the interpreter.  It adds a
"null" JIT which just errors out.

After this patch is applied it is possible to build on non-x86-64
platforms and run the interpreter without worrying about the JIT.

This is achieved by adding a translate function-pointer member to
the ubpf_vm struct. ubpf_create() then sets the pointer up to the
correct JIT.  Finally ubpf_translate() now delegates to that function
pointer.

To enable code reuse some common code from ubpf_jit_x86_64.c is moved
into a new file ubpf_jit.c.

Also what was ubpf_translate() in ubpf_jit_x86_64.c is renmaed
ubpf_translate_x86_64.c.

The build process assumes that all backends can be compiled on all
platforms.  It then relies on the linker to not link in unused backends.

The code also assumes that only the JIT backend targeting the platform
the code is run on will is needed.

Finally, the testing infrastructure is updated to support non-x86-64
platforms.
The elf tests fail on Arm but not x86-64.  This seems to be due to the
local field of st_other not eing set on symbols.

We work around this issue by setting local to 0 on all symbols.  This is
a good catch-all value as it generally means "default".
This can be useful to:
- Inspect registers after program execution.
- Determine where registers should be stored.

Signed-off-by: Martin Ichilevici de Oliveira <martin.i.oliveira@gmail.com>
This adds initial implementation of the Arm64 JIT.
Added support for clang function and string relocations, these show as up as
R_BPF_64_64 and R_BPF_64_32 in *-readelf relocations. Support for nosetests elf
tests is still TBD.

Signed-off-by: Ray Kinsella <mdr@ashroe.eu>
@mdr78
Copy link
Author

mdr78 commented Jul 14, 2022

Ok will do, needs some tidyup in places also.

Any update on this?

Looking at it now.

@mdr78
Copy link
Author

mdr78 commented Jul 14, 2022

Ok will do, needs some tidyup in places also.

Any update on this?

Looking at it now.

Looks like I have made a mess of this PR - I might have to close it and open a new one.

@mdr78 mdr78 closed this Aug 16, 2022
@mdr78
Copy link
Author

mdr78 commented Aug 16, 2022

Made a mess of this one, will create a new pr.

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

Successfully merging this pull request may close these issues.

None yet

6 participants