microsoft / microsoft/ebpf-for-windows

bpf2c returns error if there are no program sections found in the ELF file

Open
#3,597 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug help wanted P3 triaged
Dominant language
C
Stars
3.6k
Forks
311
Avg merge
6d 10h
Merged PRs (30d)
21

Description

### Describe the bug

As reported by Anurag, bpf2c returns error if there are no program sections found in the ELF file

Libbpf supports loading such ELF files that only contain maps.

### OS information

_No response_

### Steps taken to reproduce bug

TBD

### Expected behavior

A .sys file should be genertaed that contains maps but no programs.

### Actual outcome

bpf2c fails.

### Additional details

_No response_

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start at the bpf2c entry point that processes ELF program sections and reproduce the failure with an ELF containing maps but no programs. Done means bpf2c generates a .sys file containing the maps without requiring any program sections.

Written by the indexing model from the issue text.

Assessment

Tech stack
c
Domain
tooling
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.