[PATCH] D23165: [ELF] - Linkerscript: implement SIZEOF_HEADERS.

George Rimar via llvm-commits llvm-commits at lists.llvm.org
Mon Aug 8 03:20:36 PDT 2016


grimar added inline comments.

================
Comment at: ELF/LinkerScript.cpp:241
@@ -240,3 +240,3 @@
   // Assign addresses as instructed by linker script SECTIONS sub-commands.
-  Dot = Out<ELFT>::ElfHeader->getSize() + Out<ELFT>::ProgramHeaders->getSize();
+  Dot = Opt.ManualHeadersSize ? 0 : getSizeOfHeaders();
   uintX_t MinVA = std::numeric_limits<uintX_t>::max();
----------------
ruiu wrote:
> I do see why you are doing this, but this is pretty obscure. Do we really have to do this?
When SIZE_OF_HEADERS is not used it is convenient behavior to have location counted be shifted automatically. Otherwise users will have to leave space for headers manually which probably not the best experience we can offer.

Or do you mean we should always shift dot here on size of headers ? That means that if script contains SIZE_OF_HEADES there will be some waste of VA space. That does not allow script to control everything also, what I guess can be expected for those who want to set up everything manually.


https://reviews.llvm.org/D23165





More information about the llvm-commits mailing list