[PATCH] D39548: [ELF] Set the section size on the section start symbols

Alexander Richardson via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Nov 7 04:52:21 PST 2017


arichardson added a comment.

In https://reviews.llvm.org/D39548#917753, @peter.smith wrote:

> Thanks for the detailed answer. Does the static linker create the __cap_relocs section, or is it some standalone tool? If it is the static linker itself, then presumably there could be alternative ways of obtaining the size for the capability that would not involve propagating the change into the symbol table. For example set a flag on the symbol definition so that when you are writing out the __cap_relocs and encounter a flagged symbol with size 0, you can calculate it from the OutputSection. Not as elegant for the __cap_relocs section but it might be ok to upstream the flagging mechanism?


Originally we used a standalone tool that extracted the information from the symbol table because we had to use BFD for linking. Now we can use LLD (as long as we apply the multi-GOT patch https://reviews.llvm.org/D31528) for building all of FreeBSD (CheriBSD) so I have integrated the `__cap_relocs` generation into our fork of LLD. Setting a flag on the symbol so that we can calculate the real size when we fill in the `__cap_relocs` sections would be a great solution. @ruiu would adding such a flag to Symbol be acceptable?


https://reviews.llvm.org/D39548





More information about the llvm-commits mailing list