[MC] Set defaults based on section names and support name suffixes
authorPetr Hosek <phosek@chromium.org>
Tue, 4 Apr 2017 23:32:45 +0000 (23:32 +0000)
committerPetr Hosek <phosek@chromium.org>
Tue, 4 Apr 2017 23:32:45 +0000 (23:32 +0000)
commit880cfd45fcc0b9417a7c8d22c45b38dd1fe23929
tree48380a6f6e41c51c44c2dbc4c9af36e098e11dcd
parentd3c03a5ddd9523386ef766a397483d09a60f7156
[MC] Set defaults based on section names and support name suffixes

Set correct default flags and section type based on its name for .text,
.data, .bss, .init_array, .fini_array, .preinit_array, .tdata, and .tbss
and support section name suffixes for .data.*, .rodata.*, .text.*,
.bss.*, .tdata.* and .tbss.* which matches the behavior of GAS.

Fixes PR31888.

Differential Revision: https://reviews.llvm.org/D30229

llvm-svn: 299484
llvm/lib/MC/MCParser/ELFAsmParser.cpp
llvm/test/MC/ELF/section.s