[PATCH] D136078: Use-after-return sanitizer binary metadata
Marco Elver via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Fri Dec 2 12:54:44 PST 2022
melver added a comment.
In D136078#3966187 <https://reviews.llvm.org/D136078#3966187>, @melver wrote:
>>> Do you have any other ideas on how to dead with this?
>>
>> It's strange we've not encountered this elsewhere - this must be some special (old?) linker. I'll investigate...
>
> GNU ld <= 2.35 does not support mixed SHF_LINK_ORDER and non-SHF_LINK_ORDER sections.
>
> This is about the relative order of the section w.r.t. other sections it references (we link it to the function section, see MCObjectFileInfo::getPCSection) when the linker merges the sections. From what I can find, we need to retain SHF_LINK_ORDER to support gc-sections properly.
>
> This is a good summary: https://maskray.me/blog/2021-01-31-metadata-sections-comdat-and-shf-link-order
> @MaskRay
>
> I'm going to try and see how I can add the SHF_LINK_ORDER attribute to the section output for the dummy variable.
This should fix it: https://reviews.llvm.org/D139224 - at least whatever I was able to reproduce with the linker version I found (2.31) seems to work.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D136078/new/
https://reviews.llvm.org/D136078
More information about the cfe-commits
mailing list