HomePhabricator

.gcc_except_table: Set SHF_LINK_ORDER if binutils>=2.36, and drop unneeded…

Authored by MaskRay on Feb 5 2021, 9:45 PM.

Description

.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.)

Details

Committed
MaskRayFeb 5 2021, 9:45 PM
Parents
rG6a1235211dab: [ELF] --gc-sections: collect unused SHF_LINK_ORDER .gcc_except_table
Branches
Unknown
Tags
Unknown