[PATCH] D58047: [LLD][ELF][ARM] Synthesise missing .ARM.exidx sections.

Peter Smith via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Feb 14 02:29:01 PST 2019

peter.smith added a comment.

The LLVM associated symbol metadata uses SHF_LINK_ORDER (https://llvm.org/docs/LangRef.html#associated-metadata) and I think this is used by the at least some of the sanitizers. I think it would be difficult to get rid of completely.

I think it could be possible to implement .ARM.exidx as a single SyntheticSection as the unwinder requires there to be only one contiguous range. I'm not sure whether it would be considerably better than what we have now. I can think of a couple of ways to implement it:

- Have the .ARM.exidx synthetic section be in effect a container for all .ARM.exidx InputSections, with a finalize() that does the sythesize entry, equivalent of SHF_LINK_ORDER and compression. This would in effect move some of the code out of Writer.cpp and into SyntheticSections.cpp but much of it would be the same. Instead of making a small number of Synthetic .ARM.exidx sections we'd create a single one, then write some code to filter all the InputSections into it.
- Do something more radical like copying the contents of all .ARM.exidx sections along with an abstraction of the relocations (all the same type) into a giant buffer or table structure. We'd then sort the table, compress it and handle the relocations in writeTo() like we do with the PLT sections.

I can't immediately think that either one of those would be much better that what we have. If either of those or any other idea sounds plausible I can write a prototype to see what it looks like, I'd prefer to only do that if an approach sounds appealing though?



More information about the llvm-commits mailing list