Skip to content

Commit

Permalink
btf: use asm.Comment to annotate poisoned CO-RE relocations instead
Browse files Browse the repository at this point in the history
Signed-off-by: Marcus Wichelmann <mail@marcusw.de>
  • Loading branch information
MarcusWichelmann committed Apr 3, 2024
1 parent 16dd7cb commit 8edd81a
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions btf/core.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,13 +57,9 @@ func (f *COREFixup) Apply(ins *asm.Instruction) error {

// Add context to the kernel verifier output.
if source := ins.Source(); source != nil {
*ins = ins.WithSource(&Line{
line: fmt.Sprintf("instruction poisoned by CO-RE: %s", source),
})
*ins = ins.WithSource(asm.Comment(fmt.Sprintf("instruction poisoned by CO-RE: %s", source)))
} else {
*ins = ins.WithSource(&Line{
line: "instruction poisoned by CO-RE",
})
*ins = ins.WithSource(asm.Comment("instruction poisoned by CO-RE"))
}

return nil
Expand Down

0 comments on commit 8edd81a

Please sign in to comment.