[PATCH] D24801: [ELF] - Fix combination of -script and relocatable output.

George Rimar via llvm-commits llvm-commits at lists.llvm.org
Fri Oct 7 07:47:24 PDT 2016


grimar added inline comments.


================
Comment at: ELF/LinkerScript.cpp:556
+    Out<ELFT>::ElfHeader->setVA(0);
+    Out<ELFT>::ProgramHeaders->setVA(Out<ELFT>::ElfHeader->getSize());
+    return;
----------------
rafael wrote:
> So  Out<ELFT>::ProgramHeaders is the only outsection with a non 0 VA?
Relocatable output does not have program headers table, it probably was copypaste mistake.

And patch was not correct. We are calculating file offsets using VA now. It has also incorrect calculation
of output section size because of that, what is noticable in testcase. 
I think if we want to support such functionality with minimal changes, the best way I can imagine is to let
script set VA and do what it do, but then set VA to 0 for all sections. That what I do in updated diff.


https://reviews.llvm.org/D24801





More information about the llvm-commits mailing list