This is an archive of the discontinued LLVM Phabricator instance.

bugfix: bpf: DATASEC names might be wrong in the BTF data
Needs RevisionPublic

Authored by agentzh on Jan 7 2022, 9:53 PM.

Details

Summary

This is because GlobalVariable objects' section fields were almost never set except for user-defined section names. So here we always set the section field.

Diff Detail

Event Timeline

agentzh created this revision.Jan 7 2022, 9:53 PM
agentzh requested review of this revision.Jan 7 2022, 9:53 PM
Herald added a project: Restricted Project. · View Herald TranscriptJan 7 2022, 9:53 PM
agentzh updated this revision to Diff 398304.Jan 7 2022, 9:57 PM

Rebased to the latest main branch of llvm-project.

Can you upload the full diff (git diff -U100000 or arc diff --update D116852) and fix the clang-format check?

We need some kind of test coverage.

llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp
590

I'm not very familiar with this code, but altering const variables like this doesn't seem like a good idea - is there any kind of existing 'fixup' call that we can use instead?

Please provide a test case to show what is the problem and how the patch addressed the problem, so reviewers can check whether this is the best approach to fix the problem or not.

RKSimon requested changes to this revision.Jan 10 2022, 5:40 AM
This revision now requires changes to proceed.Jan 10 2022, 5:40 AM