[PATCH] D86847: [Bitcode] Add BITCODE_SIZE_BLOCK_ID to encode the size of the bitcode
Steven Wu via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Tue Sep 1 10:18:11 PDT 2020
steven_wu added a comment.
In D86847#2248354 <https://reviews.llvm.org/D86847#2248354>, @MaskRay wrote:
> In D86847#2248353 <https://reviews.llvm.org/D86847#2248353>, @steven_wu wrote:
>
>> I am a bit worry that linker might concatenate bitcode file with padding to achieve alignment requirement, etc. I guess you can create a termination block to mark the end but it is hard to seek the next start.
>
> We can set the section alignment to 1 to avoid padding: (I rushed a bit, sorry: 6ae7b403c3e1aebcb825d3dd4777d3c1149d6d67 <https://reviews.llvm.org/rG6ae7b403c3e1aebcb825d3dd4777d3c1149d6d67>)
I didn't see that. I don't really have concerns then.
In D86847#2248516 <https://reviews.llvm.org/D86847#2248516>, @dblaikie wrote:
> @bartell mentioned something about a bitcode wrapper that does provide the length - how does this patch's strategy compare to that approach? Are they redundant? Should the wrapper be replaced with this patch's approach? (or should the bitcode wrapper approach be used instead of adding this patch?)
I guess that is an implementation choice. This approach prefers a simple linker implementation, while the bitcode wrapper requires linker know to treat this section differently and write bitcode wrapper into section.
@MaskRay Do you have any specific use case in mind for this? If you are tied to a linker like `lld`, it might be better just teach `lld` to treat this section differently so we don't need worry about concatenated bitcode file.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D86847/new/
https://reviews.llvm.org/D86847
More information about the llvm-commits
mailing list