[PATCH] D67980: [WIP][CLANG][BPF] do compile-once run-everywhere relocation for bitfields

Yonghong Song via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Sat Oct 5 20:43:29 PDT 2019


yonghong-song marked an inline comment as done.
yonghong-song added inline comments.


================
Comment at: llvm/lib/Target/BPF/BPFCORE.h:17
+  enum OffsetRelocKind : uint32_t {
+    FIELD_ACCESS_OFFSET = 0,
+    FIELD_EXISTENCE,
----------------
yonghong-song wrote:
> ast wrote:
> > why ACCESS_OFFSET is necessary?
> > Isn't it the same as BYTE_OFFSET but for non-bitfield?
> > May be single kind will do?
> This is the relocation type in the .BTF.ext. FIELD_ACCESS_OFFSET corresponds to odd offset relocation. The below newly added relocations are for field info.
> I am using relocation enum except FIELD_ACCESS_OFFSET to be used for field_info in __builtin_preserve_field_info().
Now I understand what you mean. Currently BYTE_OFFSET is calculated from the start of the last enclosing struct/union members while ACCESS_OFFSET could be the offset from outer struct/union like a.b.c.d.
Let me think whether we could consolidate two.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D67980/new/

https://reviews.llvm.org/D67980





More information about the cfe-commits mailing list