OSDN Git Service

Recommit r335333 "[MC] - Add .stack_size sections into groups and link them with...
authorGeorge Rimar <grimar@accesssoftek.com>
Fri, 22 Jun 2018 10:53:47 +0000 (10:53 +0000)
committerGeorge Rimar <grimar@accesssoftek.com>
Fri, 22 Jun 2018 10:53:47 +0000 (10:53 +0000)
commitaf362952328b3f33b7be705f920a8a72c6cc8c1b
tree14c9c13df83d4bdad55922d2e9447862079e084e
parent0b0278f11bcb01f11f6e0610a022c7f7a873ae16
Recommit r335333 "[MC] - Add .stack_size sections into groups and link them with .text"

With compilation fix.

Original commit message:

D39788 added a '.stack-size' section containing metadata on function stack sizes
to output ELF files behind the new -stack-size-section flag.

This change does following two things on top:

1) Imagine the case when there are -ffunction-sections flag given and there are text sections in COMDATs.
    The patch adds a '.stack-size' section into corresponding COMDAT group, so that linker will be able to
    eliminate them fast during resolving the COMDATs.
2) Patch sets a SHF_LINK_ORDER flag and links '.stack-size' with the corresponding .text.
   With that linker will be able to do -gc-sections on dead stack sizes sections.

Differential revision: https://reviews.llvm.org/D46874

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@335336 91177308-0d34-0410-b5e6-96231b3b80d8
include/llvm/MC/MCObjectFileInfo.h
lib/CodeGen/AsmPrinter/AsmPrinter.cpp
lib/MC/MCObjectFileInfo.cpp
test/CodeGen/ARM/stack-size-section.ll
test/CodeGen/SystemZ/stack-size-section.ll
test/CodeGen/X86/stack-size-section-function-sections.ll [new file with mode: 0644]
test/CodeGen/X86/stack-size-section.ll