.gcc_except_table: Set SHF_LINK_ORDER if binutils>=2.36, and drop unneeded unique...
authorFangrui Song <i@maskray.me>
Sat, 6 Feb 2021 05:45:21 +0000 (21:45 -0800)
committerFangrui Song <i@maskray.me>
Sat, 6 Feb 2021 05:45:21 +0000 (21:45 -0800)
commite44a1009428304d2203ab5b99d479ab2a0abf53a
treed32f9607273e0b9002354d05056b6c7c3a63bbb5
parent6a1235211dab51855d51481daf4099c96221c4bf
.gcc_except_table: Set SHF_LINK_ORDER if binutils>=2.36, and drop unneeded unique ID for -fno-unique-section-names

GNU ld>=2.36 supports mixed SHF_LINK_ORDER and non-SHF_LINK_ORDER sections in an
output section, so we can set SHF_LINK_ORDER if -fbinutils-version=2.36 or above.

If -fno-function-sections or older binutils, drop unique ID for -fno-unique-section-names.
The users can just specify -fbinutils-version=2.36 or above to allow GC with both GNU ld and LLD.
(LLD does not support garbage collection of non-group non-SHF_LINK_ORDER .gcc_except_table sections.)
llvm/include/llvm/CodeGen/TargetLoweringObjectFileImpl.h
llvm/include/llvm/Target/TargetLoweringObjectFile.h
llvm/lib/CodeGen/AsmPrinter/EHStreamer.cpp
llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp
llvm/test/CodeGen/X86/gcc_except_table-multi.ll