[Target] Remove `startswith` for adding `SHF_EXCLUDE` to offload section
authorJoseph Huber <jhuber6@vols.utk.edu>
Wed, 8 Jun 2022 13:54:08 +0000 (09:54 -0400)
committerJoseph Huber <jhuber6@vols.utk.edu>
Wed, 8 Jun 2022 13:56:51 +0000 (09:56 -0400)
commit9e0dbd2a2a4adee04b31e0cfa172fc36dd4ac313
tree7821a2fa4dae75de038219d0d4949133222d7ec8
parent86a4c78047cefd98863d5c62992616a43a0240c0
[Target] Remove `startswith` for adding `SHF_EXCLUDE` to offload section

Summary:
We use the special section name `.llvm.offloading` to store device
imagees in the host object file. We want these to be stripped by the
linker as they are not used after linking so we use the `SHF_EXCLUDE`
flag to instruct the linker to drop them. We used to do this for all
sections that started with `.llvm.offloading` when we encoded metadata
in the section name itself. Now we embed a special binary containing the
metadata, we should only add the flag on this name specifically.
llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp