[PATCH] D16887: Avoid code duplication when creating dynamic relocations

Rafael Ávila de Espíndola via llvm-commits llvm-commits at lists.llvm.org
Thu Feb 4 07:46:51 PST 2016

rafael created this revision.
rafael added a reviewer: ruiu.
rafael added a subscriber: llvm-commits.
rafael set the repository for this revision to rL LLVM.

Another case where we currently have almost duplicated code is the creation of dynamic relocations. First to decide if we need one, then to decide what to write.

This patch fixes it by passing more information from the relocation scan to the section writing code. This is the same idea used for r258723.

I actually think it should be possible to simplify this further by reordering things a bit in the writer. For example, we should be able to represent almost every position in the file with an OutputSeciton and offset. When writing it out we then just need to add the offset to the OutputSection VA.




-------------- next part --------------
A non-text attachment was scrubbed...
Name: D16887.46917.patch
Type: text/x-patch
Size: 14685 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20160204/0a2fff62/attachment.bin>

More information about the llvm-commits mailing list