-
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
linux/bpf: regenerate help function with alignment to make compiler happy #21924
base: master
Are you sure you want to change the base?
Conversation
Does it still make sense then that the default alignment for function pointers on BPF targets is > 1? |
I don't think so.
Yes, I think for these ones that could be |
We match GCC and LLVM here. If we're going to change this, especially when we use LLVM as our code generator for this target, I would like to see some evidence that changing it won't cause subtle linker bugs. |
I did an experiment with
|
Can you clarify what you're trying to show? |
LLVM use |
Well, sure; C and LLVM IR don't represent pointer alignment in the type system like Zig does. So that in itself isn't surprising. But changing the default function alignment often has broader ABI ramifications. In some cases, the linker may depend on a certain minimum function alignment in order to produce correct binaries. (I don't know if that's the case for BPF.) Here's the relevant code in GCC and LLVM: |
5d3edd4
to
251604c
Compare
translate-c
251604c
to
5d3edd4
Compare
translate-c
5d3edd4
to
62b44fe
Compare
Updated with @InKryption 's suggestion. @alexrp There two things here to make BPF unusual:
|
No description provided.