[PATCH] D72899: [MC] Set sh_link to 0 if the associated symbol is undefined

Peter Smith via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Jan 24 11:01:10 PST 2020


peter.smith added a comment.

In D72899#1837842 <https://reviews.llvm.org/D72899#1837842>, @MaskRay wrote:

> I am at a loss how to proceed now.
>
> Adding people listed in D29104 <https://reviews.llvm.org/D29104> (add !associated) and D29110 <https://reviews.llvm.org/D29110> (allowed metadata dropping transforms).


Apologies, not had much time to keep up this week. To check my understanding, we have:

- A section S with a SHF_LINK_ORDER dependency with respect to a symbol that no longer has a symbol.
- When the symbol is associated then S can be GC'ed
- When the symbol is !associated then S can't be GC'ed
- We need to find something that must not GC !associated symbols and would (ideally?) permit S to be GC'ed when the symbol is associated.
- We would like this to be generic enough to not blow up, or do the wrong thing on other linkers, although I fear that might not be possible as I'm not sure SHF_LINK_ORDER behaves well outside 1 - 1 meta-data to non-metadata.

I've not got any answers right now. In LLD allowing Section S with SHF_LINK_ORDER and sh_link=0 and making the section non-GCable would work. I wouldn't be surprised if GNU ld or Gold did the wrong thing though.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D72899/new/

https://reviews.llvm.org/D72899





More information about the llvm-commits mailing list