summaryrefslogtreecommitdiffstats
path: root/llvm/lib/MC/MCObjectFileInfo.cpp
diff options
context:
space:
mode:
authorSean Eveson <eveson.sean@gmail.com>2017-11-30 13:05:14 +0000
committerSean Eveson <eveson.sean@gmail.com>2017-11-30 13:05:14 +0000
commita6bcd53d5229db563d0ba25b6385e3ca5d0820de (patch)
tree7cef0a8088cba473cf19d7eb789bad9521ea4687 /llvm/lib/MC/MCObjectFileInfo.cpp
parent661e4fbf83887a074ab3ab06ae41470cce4ff45c (diff)
downloadbcm5719-llvm-a6bcd53d5229db563d0ba25b6385e3ca5d0820de.tar.gz
bcm5719-llvm-a6bcd53d5229db563d0ba25b6385e3ca5d0820de.zip
[MC] Function stack size section.
Re applying after fixing issues in the diff, sorry for any painful conflicts/merges! Original RFC: http://lists.llvm.org/pipermail/llvm-dev/2017-August/117028.html This change adds a '.stack-size' section containing metadata on function stack sizes to output ELF files behind the new -stack-size-section flag. The section contains pairs of function symbol references (8 byte) and stack sizes (unsigned LEB128). The contents of this section can be used to measure changes to stack sizes between different versions of the compiler or a source base. The advantage of having a section is that we can extract this information when examining binaries that we didn't build, and it allows users and tools easy access to that information just by referencing the binary. There is a follow up change to add an option to clang. Thanks. Reviewers: hfinkel, MatzeB Reviewed By: MatzeB Subscribers: thegameg, asb, llvm-commits Differential Revision: https://reviews.llvm.org/D39788 llvm-svn: 319430
Diffstat (limited to 'llvm/lib/MC/MCObjectFileInfo.cpp')
-rw-r--r--llvm/lib/MC/MCObjectFileInfo.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/llvm/lib/MC/MCObjectFileInfo.cpp b/llvm/lib/MC/MCObjectFileInfo.cpp
index d8077df1469..ba0146fd9fc 100644
--- a/llvm/lib/MC/MCObjectFileInfo.cpp
+++ b/llvm/lib/MC/MCObjectFileInfo.cpp
@@ -594,6 +594,8 @@ void MCObjectFileInfo::initELFMCObjectFileInfo(const Triple &T, bool Large) {
EHFrameSection =
Ctx->getELFSection(".eh_frame", EHSectionType, EHSectionFlags);
+
+ StackSizesSection = Ctx->getELFSection(".stack_sizes", ELF::SHT_PROGBITS, 0);
}
void MCObjectFileInfo::initCOFFMCObjectFileInfo(const Triple &T) {
OpenPOWER on IntegriCloud