This is an archive of the discontinued LLVM Phabricator instance.

[InstrProfiling] Use nobits for __llvm_prf_cnts with binutils >=2.28
AcceptedPublic

Authored by phosek on Feb 23 2021, 2:31 PM.

Details

Summary

binutils <2.28 have a bug which causes start_/stop_ symbols have
incorrect address for nobits section which causes counters to come up
as empty in raw profiles.

Diff Detail

Event Timeline

phosek created this revision.Feb 23 2021, 2:31 PM
phosek requested review of this revision.Feb 23 2021, 2:31 PM
Herald added a project: Restricted Project. · View Herald TranscriptFeb 23 2021, 2:31 PM
phosek updated this revision to Diff 325908.Feb 23 2021, 2:55 PM

Updated test and extra comment.

kazu added a subscriber: kazu.Feb 23 2021, 4:19 PM

This patch fixes the problem I was having while building an instrumented binary.

davidxl accepted this revision.Feb 23 2021, 4:37 PM

lgtm

This revision is now accepted and ready to land.Feb 23 2021, 4:37 PM
MaskRay accepted this revision.Feb 23 2021, 5:00 PM

Do you have a link for the bug? Might to good mentioning in the description.

llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp
445

Nit: end a complete sentence with a period.

llvm/test/Instrumentation/InstrProfiling/X86/nobits.ll
2

Nit: you can drop -unknown-linux-gnu because this tests generic ELF behavior.

If this patch could be pushed soon that'd be great; we need it to unblock PowerPC buildbots.

If this patch could be pushed soon that'd be great; we need it to unblock PowerPC buildbots.

I've reverted the original change D97110, are you still seeing the issue?

If this patch could be pushed soon that'd be great; we need it to unblock PowerPC buildbots.

I've reverted the original change D97110, are you still seeing the issue?

Apologies it has indeed gone away. Thanks!