[PATCH] D26980: [ELF] FIxup buffer pointer before writing synthetic section

Eugene Leviant via llvm-commits llvm-commits at lists.llvm.org
Tue Nov 22 10:13:25 PST 2016


evgeny777 created this revision.
evgeny777 added a reviewer: ruiu.
evgeny777 added subscribers: grimar, ikudrin, llvm-commits.
evgeny777 set the repository for this revision to rL LLVM.
evgeny777 added a project: lld.

I think it makes sense to fix it now, because George (grimar) is preparing a patch allowing to use synthetic sections in linker script.
Normally this is done inside InputSection::writeTo, but synthetic sections were initially output sections and don't do this.


Repository:
  rL LLVM

https://reviews.llvm.org/D26980

Files:
  ELF/InputSection.cpp


Index: ELF/InputSection.cpp
===================================================================
--- ELF/InputSection.cpp
+++ ELF/InputSection.cpp
@@ -532,7 +532,7 @@
     return;
 
   if (auto *S = dyn_cast<SyntheticSection<ELFT>>(this)) {
-    S->writeTo(Buf);
+    S->writeTo(Buf + OutSecOff);
     return;
   }
 


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D26980.78887.patch
Type: text/x-patch
Size: 316 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20161122/829e2e11/attachment.bin>


More information about the llvm-commits mailing list